From 3d1647d7703c7eb3d2246dd6d3efd4e888b9f985 Mon Sep 17 00:00:00 2001 From: wangshuide2020 <7511764+wangshuide2020@user.noreply.gitee.com> Date: Mon, 21 Dec 2020 20:20:59 +0800 Subject: [PATCH] update the example of NMSWithMask operator and modify the format of description of ScatterUpdate operator. --- mindspore/ops/operations/array_ops.py | 2 +- mindspore/ops/operations/math_ops.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 980696251a..72c113ad3f 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -3167,7 +3167,7 @@ class ScatterUpdate(_ScatterOp_Dynamic): Inputs: - **input_x** (Parameter) - The target tensor, with data type of Parameter. - **indices** (Tensor) - The index of input tensor. With int32 data type. - If there are duplicates in indices, the order for updating is undefined. + If there are duplicates in indices, the order for updating is undefined. - **updates** (Tensor) - The tensor to update the input tensor, has the same type as input, and updates.shape = indices.shape + input_x.shape[1:]. diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index 0dcb49c84e..726b67df6b 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -3376,9 +3376,9 @@ class NMSWithMask(PrimitiveWithInfer): >>> inputs = Tensor(bbox, mindspore.float32) >>> nms = ops.NMSWithMask(0.5) >>> output_boxes, indices, mask = nms(inputs) - >>> print(output_boxes) - [[0.39990234 0.19995117 0.7998047 0.5 0.09997559] - [0.39990234 0.30004883 1. 1.0996094 0.7001953 ]] + >>> indices_np = indices.asnumpy() + >>> print(indices_np[mask.asnumpy()]) + [0 1] """ @prim_attr_register