Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix sphinx issues #13256

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions src/operator/contrib/index_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/operator/contrib/quadratic_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
4 changes: 2 additions & 2 deletions src/operator/contrib/roi_align.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down