update the example of Unique and EditDistance and registration info of BiasAddGrad

This commit is contained in:
wangshuide2020 2021-02-09 10:29:31 +08:00
parent 9e255ee475
commit 6b10de0220
2 changed files with 3 additions and 5 deletions

View File

@ -767,7 +767,6 @@ class Unique(Primitive):
... return output, indices
...
>>> x = Tensor(np.array([1, 2, 5, 2]), mindspore.int32)
>>> context.set_context(mode=context.GRAPH_MODE)
>>> net = UniqueNet()
>>> output = net(x)
>>> print(output)
@ -4625,11 +4624,10 @@ class EditDistance(PrimitiveWithInfer):
>>> from mindspore import Tensor
>>> import mindspore.nn as nn
>>> import mindspore.ops.operations as ops
>>> context.set_context(mode=context.GRAPH_MODE)
>>> class EditDistance(nn.Cell):
... def __init__(self, hypothesis_shape, truth_shape, normalize=True):
... super(EditDistance, self).__init__()
... self.edit_distance = P.EditDistance(normalize)
... self.edit_distance = ops.EditDistance(normalize)
... self.hypothesis_shape = hypothesis_shape
... self.truth_shape = truth_shape
...

View File

@ -4887,9 +4887,9 @@ class BinaryCrossEntropy(PrimitiveWithInfer):
Otherwise, the output is a scalar.
Raises:
TypeError: If dtype of `input_x`, `input_y` or `weight`(if given) is neither float16 not float32.
TypeError: If dtype of `input_x`, `input_y` or `weight` (if given) is neither float16 not float32.
ValueError: If `reduction` is not one of 'none', 'mean', 'sum'.
ValueError: If shape of `input_y` is not the same as `input_x` or `weight`(if given).
ValueError: If shape of `input_y` is not the same as `input_x` or `weight` (if given).
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``