diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index b3a6aaaff7..b14a4d8977 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -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 ... diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index e382152ef5..9651cc44e5 100644 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -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``