Rectification of operator ease of use part 3

This commit is contained in:
dinglinhe 2021-06-17 15:10:27 +08:00
parent 72702588bb
commit 737963459b
4 changed files with 696 additions and 554 deletions

View File

@ -1182,7 +1182,7 @@ class FocalLoss(Loss):
The loss function proposed by Kaiming team in their paper ``Focal Loss for Dense Object Detection`` improves the
effect of image object detection. It is a loss function to solve the imbalance of categories and the difference of
classification difficulty. If you want to learn more, please refer to the paper.
`Focal Loss for Dense Object Detection https://arxiv.org/pdf/1708.02002.pdf`_. The function is shown as follows:
`Focal Loss for Dense Object Detection <https://arxiv.org/pdf/1708.02002.pdf>`_. The function is shown as follows:
.. math::
FL(p_t) = -(1-p_t)^\gamma log(p_t)

View File

@ -171,9 +171,9 @@ class AllGather(PrimitiveWithInfer):
... def construct(self, x):
... return self.allgather(x)
...
>>> input_ = Tensor(np.ones([2, 8]).astype(np.float32))
>>> input_x = Tensor(np.ones([2, 8]).astype(np.float32))
>>> net = Net()
>>> output = net(input_)
>>> output = net(input_x)
>>> print(output)
[[1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1.]
@ -462,9 +462,9 @@ class Broadcast(PrimitiveWithInfer):
... def construct(self, x):
... return self.broadcast((x,))
...
>>> input_ = Tensor(np.ones([2, 4]).astype(np.int32))
>>> input_x = Tensor(np.ones([2, 4]).astype(np.int32))
>>> net = Net()
>>> output = net(input_)
>>> output = net(input_x)
>>> print(output)
(Tensor(shape[2,4], dtype=Int32, value=
[[1, 1, 1, 1],

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,11 @@ class Assign(Primitive):
Inputs:
- **variable** (Parameter) - The `Parameter`.
- **value** (Tensor) - The value to be assigned.
:math:`(N,*)` where :math:`*` means ,any number of additional dimensions, its rank should less than 8.
- **value** (Tensor) - The value to be assigned, has the same shape with `variable`.
Outputs:
Tensor, has the same type as original `variable`.
Tensor, has the same data type and shape as original `variable`.
Raises:
TypeError: If `variable` is not a Parameter.