This is an automated email from the ASF dual-hosted git repository.
skm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 339e085 Doc fixes (#13256)
339e085 is described below
commit 339e0850ad3035e23895bf44f1d707036679ca6b
Author: Roshani Nagmote <[email protected]>
AuthorDate: Thu Nov 15 10:14:31 2018 -0800
Doc fixes (#13256)
---
src/operator/contrib/index_copy.cc | 36 +++++++++++++++++++-----------------
src/operator/contrib/quadratic_op.cc | 6 +++++-
src/operator/contrib/roi_align.cc | 4 ++--
3 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/src/operator/contrib/index_copy.cc
b/src/operator/contrib/index_copy.cc
index 316c8a7..70a32a1 100644
--- a/src/operator/contrib/index_copy.cc
+++ b/src/operator/contrib/index_copy.cc
@@ -37,30 +37,32 @@ static bool IndexCopyType(const nnvm::NodeAttrs& attrs,
}
NNVM_REGISTER_OP(_contrib_index_copy)
-.describe(R"code(Copies the elements of a `new_tensor` into the `old_tensor`
by
-selecting the indices in the order given in `index`. The output will be a new
tensor
-contains the rest elements of old tensor and the copied elements of new
tensor.
-For example, if `index[i] == j`, then the `i`th row of `new_tensor` is copied
to the
-`j`th row of output.
+.describe(R"code(Copies the elements of a `new_tensor` into the `old_tensor`.
-The `index` must be a vector and it must have the same size with the `0`th
dimimention of
-`new_tensor`. Also, the `0`th dimimention of old_tensor must `>=` the `0`th
dimimention of
+This operator copies the elements by selecting the indices in the order given
in `index`.
+The output will be a new tensor containing the rest elements of old tensor and
+the copied elements of new tensor.
+For example, if `index[i] == j`, then the `i` th row of `new_tensor` is copied
to the
+`j` th row of output.
+
+The `index` must be a vector and it must have the same size with the `0` th
dimension of
+`new_tensor`. Also, the `0` th dimension of old_tensor must `>=` the `0` th
dimension of
`new_tensor`, or an error will be raised.
Examples::
-x = mx.nd.zeros((5,3))
-t = mx.nd.array([[1,2,3],[4,5,6],[7,8,9]])
-index = mx.nd.array([0,4,2])
+ x = mx.nd.zeros((5,3))
+ t = mx.nd.array([[1,2,3],[4,5,6],[7,8,9]])
+ index = mx.nd.array([0,4,2])
-mx.nd.contrib.index_copy(x, index, t)
+ mx.nd.contrib.index_copy(x, index, t)
-[[1. 2. 3.]
- [0. 0. 0.]
- [7. 8. 9.]
- [0. 0. 0.]
- [4. 5. 6.]]
-<NDArray 5x3 @cpu(0)>
+ [[1. 2. 3.]
+ [0. 0. 0.]
+ [7. 8. 9.]
+ [0. 0. 0.]
+ [4. 5. 6.]]
+ <NDArray 5x3 @cpu(0)>
)code" ADD_FILELINE)
.set_num_inputs(3)
diff --git a/src/operator/contrib/quadratic_op.cc
b/src/operator/contrib/quadratic_op.cc
index d8b2d78..043379e 100644
--- a/src/operator/contrib/quadratic_op.cc
+++ b/src/operator/contrib/quadratic_op.cc
@@ -29,12 +29,16 @@ namespace op {
DMLC_REGISTER_PARAMETER(QuadraticParam);
NNVM_REGISTER_OP(_contrib_quadratic)
-.describe(R"code(This operators implements the quadratic function:
+.describe(R"code(This operators implements the quadratic function.
+
.. math::
f(x) = ax^2+bx+c
+
where :math:`x` is an input tensor and all operations
in the function are element-wise.
+
Example::
+
x = [[1, 2], [3, 4]]
y = quadratic(data=x, a=1, b=2, c=3)
y = [[6, 11], [18, 27]]
diff --git a/src/operator/contrib/roi_align.cc
b/src/operator/contrib/roi_align.cc
index 3ce2213..7667567 100644
--- a/src/operator/contrib/roi_align.cc
+++ b/src/operator/contrib/roi_align.cc
@@ -515,8 +515,8 @@ input features at four regularly sampled locations in each
RoI bin.
Then the feature map can be aggregated by avgpooling.
-Reference
----------
+References
+----------
He, Kaiming, et al. "Mask R-CNN." ICCV, 2017
)code" ADD_FILELINE)