Browse Source

!12298 update the example of Unique and EditDistance and registration info of BiasAddGrad.

From: @wangshuide2020
Reviewed-by: 
Signed-off-by:
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
d1d03a8eff
2 changed files with 3 additions and 5 deletions
  1. +1
    -3
      mindspore/ops/operations/array_ops.py
  2. +2
    -2
      mindspore/ops/operations/nn_ops.py

+ 1
- 3
mindspore/ops/operations/array_ops.py 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)
@@ -4613,11 +4612,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
...


+ 2
- 2
mindspore/ops/operations/nn_ops.py 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``


Loading…
Cancel
Save