Skip to content

Commit ec704f1

Browse files
author
Olivier
committed
Fix formatting
1 parent 0218c49 commit ec704f1

File tree

3 files changed

+39
-38
lines changed

3 files changed

+39
-38
lines changed

src/operator/tensor/elemwise_unary_op_basic.cc

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*!
21-
* \file elemwise_unary_op.cc
21+
* \file elemwise_unary_op_basic.cc
2222
* \brief CPU Implementation of unary function.
2323
*/
2424
#include <mxnet/base.h>
@@ -419,7 +419,7 @@ The storage type of ``trunc`` output depends upon the input storage type:
419419
// fix
420420
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(fix, cpu, mshadow_op::fix)
421421
MXNET_ADD_SPARSE_OP_ALIAS(fix)
422-
.describe(R"code(Returns element-wise rounded value to the nearest \
422+
.describe(R"code(Returns element-wise rounded value to the nearest \
423423
integer towards zero of the input.
424424
425425
Example::
@@ -436,7 +436,7 @@ The storage type of ``fix`` output depends upon the input storage type:
436436
// square
437437
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(square, cpu, mshadow_op::square)
438438
MXNET_ADD_SPARSE_OP_ALIAS(square)
439-
.describe(R"code(Returns element-wise squared value of the input.
439+
.describe(R"code(Returns element-wise squared value of the input.
440440
441441
.. math::
442442
square(x) = x^2
@@ -452,15 +452,15 @@ The storage type of ``square`` output depends upon the input storage type:
452452
- square(csr) = csr
453453
454454
)code" ADD_FILELINE)
455-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_square"});
455+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_square"});
456456

457457
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU(_backward_square,
458458
unary_bwd<mshadow_op::square_grad>);
459459

460460
// sqrt
461461
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(sqrt, cpu, mshadow_op::square_root)
462462
MXNET_ADD_SPARSE_OP_ALIAS(sqrt)
463-
.describe(R"code(Returns element-wise square-root value of the input.
463+
.describe(R"code(Returns element-wise square-root value of the input.
464464
465465
.. math::
466466
\textrm{sqrt}(x) = \sqrt{x}
@@ -475,15 +475,15 @@ The storage type of ``sqrt`` output depends upon the input storage type:
475475
- sqrt(row_sparse) = row_sparse
476476
477477
)code" ADD_FILELINE)
478-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_backward_sqrt"});
478+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_backward_sqrt"});
479479

480480
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_sqrt,
481481
unary_bwd<mshadow_op::square_root_grad>);
482482

483483
// rsqrt
484484
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(rsqrt, cpu, mshadow_op::reciprocal_square_root)
485485
MXNET_ADD_SPARSE_OP_ALIAS(rsqrt)
486-
.describe(R"code(Returns element-wise inverse square-root value of the input.
486+
.describe(R"code(Returns element-wise inverse square-root value of the input.
487487
488488
.. math::
489489
rsqrt(x) = 1/\sqrt{x}
@@ -495,14 +495,14 @@ Example::
495495
The storage type of ``rsqrt`` output is always dense
496496
497497
)code" ADD_FILELINE)
498-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_rsqrt"});
498+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_rsqrt"});
499499

500-
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_rsqrt,
501-
unary_bwd<mshadow_op::reciprocal_square_root_grad>);
500+
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(
501+
_backward_rsqrt, unary_bwd<mshadow_op::reciprocal_square_root_grad>);
502502

503503
// cbrt
504504
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(cbrt, cpu, mshadow_op::cube_root)
505-
.describe(R"code(Returns element-wise cube-root value of the input.
505+
.describe(R"code(Returns element-wise cube-root value of the input.
506506
507507
.. math::
508508
cbrt(x) = \sqrt[3]{x}
@@ -512,14 +512,14 @@ Example::
512512
cbrt([1, 8, -125]) = [1, 2, -5]
513513
514514
)code" ADD_FILELINE)
515-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_backward_cbrt"});
515+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_backward_cbrt"});
516516

517517
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_cbrt,
518518
unary_bwd<mshadow_op::cube_root_grad>);
519519

520520
// rcbrt
521521
MXNET_OPERATOR_REGISTER_UNARY(rcbrt)
522-
.describe(R"code(Returns element-wise inverse cube-root value of the input.
522+
.describe(R"code(Returns element-wise inverse cube-root value of the input.
523523
524524
.. math::
525525
rcbrt(x) = 1/\sqrt[3]{x}
@@ -529,17 +529,18 @@ Example::
529529
rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
530530
531531
)code" ADD_FILELINE)
532-
.set_attr<FCompute>("FCompute<cpu>", UnaryOp::Compute<cpu, mshadow_op::reciprocal_cube_root>)
533-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_rcbrt"});
532+
.set_attr<FCompute>("FCompute<cpu>", UnaryOp::Compute<cpu, mshadow_op::reciprocal_cube_root>)
533+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_rcbrt"});
534534

535535
MXNET_OPERATOR_REGISTER_BINARY(_backward_rcbrt)
536536
.set_attr<FCompute>("FCompute<cpu>",
537-
ElemwiseBinaryOp::Compute<cpu, unary_bwd<mshadow_op::reciprocal_cube_root_grad> >);
537+
ElemwiseBinaryOp::Compute<cpu,
538+
unary_bwd<mshadow_op::reciprocal_cube_root_grad>>);
538539

539540
// exp
540541
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(exp, cpu, mshadow_op::exp)
541542
MXNET_ADD_SPARSE_OP_ALIAS(exp)
542-
.describe(R"code(Returns element-wise exponential value of the input.
543+
.describe(R"code(Returns element-wise exponential value of the input.
543544
544545
.. math::
545546
exp(x) = e^x \approx 2.718^x
@@ -551,50 +552,50 @@ Example::
551552
The storage type of ``exp`` output is always dense
552553
553554
)code" ADD_FILELINE)
554-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_mul"});
555+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseOut{"_mul"});
555556

556557
// log
557558
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(log, cpu, mshadow_op::log)
558559
MXNET_ADD_SPARSE_OP_ALIAS(log)
559-
.describe(R"code(Returns element-wise Natural logarithmic value of the input.
560+
.describe(R"code(Returns element-wise Natural logarithmic value of the input.
560561
561562
The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
562563
563564
The storage type of ``log`` output is always dense
564565
565566
)code" ADD_FILELINE)
566-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
567+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
567568

568569
// log10
569570
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(log10, cpu, mshadow_op::log10)
570571
MXNET_ADD_SPARSE_OP_ALIAS(log10)
571-
.describe(R"code(Returns element-wise Base-10 logarithmic value of the input.
572+
.describe(R"code(Returns element-wise Base-10 logarithmic value of the input.
572573
573574
``10**log10(x) = x``
574575
575576
The storage type of ``log10`` output is always dense
576577
577578
)code" ADD_FILELINE)
578-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
579+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
579580

580581
// log2
581582
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(log2, cpu, mshadow_op::log2)
582583
MXNET_ADD_SPARSE_OP_ALIAS(log2)
583-
.describe(R"code(Returns element-wise Base-2 logarithmic value of the input.
584+
.describe(R"code(Returns element-wise Base-2 logarithmic value of the input.
584585
585586
``2**log2(x) = x``
586587
587588
The storage type of ``log2`` output is always dense
588589
589590
)code" ADD_FILELINE)
590-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
591+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log"});
591592

592593
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_log, unary_bwd<mshadow_op::log_grad>);
593594

594595
// log1p
595596
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(log1p, cpu, mshadow_op::log1p)
596597
MXNET_ADD_SPARSE_OP_ALIAS(log1p)
597-
.describe(R"code(Returns element-wise ``log(1 + x)`` value of the input.
598+
.describe(R"code(Returns element-wise ``log(1 + x)`` value of the input.
598599
599600
This function is more accurate than ``log(1 + x)`` for small ``x`` so that
600601
:math:`1+x\approx 1`
@@ -605,15 +606,15 @@ The storage type of ``log1p`` output depends upon the input storage type:
605606
- log1p(row_sparse) = row_sparse
606607
607608
)code" ADD_FILELINE)
608-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log1p"});
609+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_log1p"});
609610

610611
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_log1p,
611612
unary_bwd<mshadow_op::log1p_grad>);
612613

613614
// expm1
614615
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(expm1, cpu, mshadow_op::expm1)
615616
MXNET_ADD_SPARSE_OP_ALIAS(expm1)
616-
.describe(R"code(Returns ``exp(x) - 1`` computed element-wise on the input.
617+
.describe(R"code(Returns ``exp(x) - 1`` computed element-wise on the input.
617618
618619
This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
619620
@@ -623,34 +624,34 @@ The storage type of ``expm1`` output depends upon the input storage type:
623624
- expm1(row_sparse) = row_sparse
624625
625626
)code" ADD_FILELINE)
626-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_expm1"});
627+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_expm1"});
627628

628629
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_expm1, unary_bwd<mshadow_op::exp>);
629630

630631
// gamma
631632
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(gamma, cpu, mshadow_op::gamma)
632633
MXNET_ADD_SPARSE_OP_ALIAS(gamma)
633-
.describe(R"code(Returns the gamma function (extension of the factorial function \
634+
.describe(R"code(Returns the gamma function (extension of the factorial function \
634635
to the reals), computed element-wise on the input array.
635636
636637
The storage type of ``gamma`` output is always dense
637638
638639
)code")
639-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_gamma"});
640+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_gamma"});
640641

641642
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_gamma,
642643
unary_bwd<mshadow_op::gamma_grad>);
643644

644645
// gammaln
645646
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE_DR(gammaln, cpu, mshadow_op::gammaln)
646647
MXNET_ADD_SPARSE_OP_ALIAS(gammaln)
647-
.describe(R"code(Returns element-wise log of the absolute value of the gamma function \
648+
.describe(R"code(Returns element-wise log of the absolute value of the gamma function \
648649
of the input.
649650
650651
The storage type of ``gammaln`` output is always dense
651652
652653
)code")
653-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_gammaln"});
654+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{"_backward_gammaln"});
654655

655656
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_gammaln,
656657
unary_bwd<mshadow_op::gammaln_grad>);

src/operator/tensor/elemwise_unary_op_basic.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919

2020
/*!
21-
* \file elemwise_unary_op.cu
22-
* \brief GPU Implementation of unary function.
21+
* \file elemwise_unary_op_trig.cu
22+
* \brief GPU Implementation of unary trigometric functions.
2323
*/
2424
#include "./elemwise_binary_op.h"
2525

src/operator/tensor/elemwise_unary_op_trig.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919

2020
/*!
21-
* \file elemwise_unary_op.cc
22-
* \brief CPU Implementation of unary function.
21+
* \file elemwise_unary_op_trig.cc
22+
* \brief CPU Implementation of unary trigometric functions.
2323
*/
2424
#include <mxnet/base.h>
2525
#include "elemwise_unary_op.h"
@@ -31,7 +31,7 @@ namespace op {
3131
// sin
3232
MXNET_OPERATOR_REGISTER_UNARY_WITH_SPARSE(sin, cpu, mshadow_op::sin)
3333
MXNET_ADD_SPARSE_OP_ALIAS(sin)
34-
.describe(R"code(Computes the element-wise sine of the input array.
34+
.describe(R"code(Computes the element-wise sine of the input array.
3535
3636
The input should be in radians (:math:`2\pi` rad equals 360 degrees).
3737
@@ -44,7 +44,7 @@ The storage type of ``sin`` output depends upon the input storage type:
4444
- sin(row_sparse) = row_sparse
4545
4646
)code" ADD_FILELINE)
47-
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{ "_backward_sin" });
47+
.set_attr<nnvm::FGradient>("FGradient", ElemwiseGradUseIn{ "_backward_sin" });
4848

4949
MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_sin, unary_bwd<mshadow_op::sin_grad>);
5050

0 commit comments

Comments
 (0)