From 6b10de02204c0bd91ad71f94d71fd238dbcbb971 Mon Sep 17 00:00:00 2001 From: wangshuide2020 <7511764+wangshuide2020@user.noreply.gitee.com> Date: Tue, 9 Feb 2021 10:29:31 +0800 Subject: [PATCH] update the example of Unique and EditDistance and registration info of BiasAddGrad --- mindspore/ops/operations/array_ops.py | 4 +--- mindspore/ops/operations/nn_ops.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index b882fb3954..1224a5263a 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) @@ -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 ... 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``