From 10877f077e8f2db69487e4b3eeb5924722c9df5d Mon Sep 17 00:00:00 2001 From: simson <526422051@qq.com> Date: Fri, 17 Apr 2020 10:33:46 +0800 Subject: [PATCH] modify examples of Cast/NMSWithMask --- mindspore/ops/operations/array_ops.py | 3 +-- mindspore/ops/operations/math_ops.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 0af284b947..57dbfc621d 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -174,10 +174,9 @@ class Cast(PrimitiveWithInfer): Examples: >>> input_np = np.random.randn(2, 3, 4, 5).astype(np.float32) >>> input_x = Tensor(input_np) - >>> type_dst = mindspore.int32 + >>> type_dst = mindspore.float16 >>> cast = P.Cast() >>> result = cast(input_x, type_dst) - >>> expect = input_np.astype(type_dst) """ @prim_attr_register diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index e390b6b589..3665f3c023 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -1872,7 +1872,7 @@ class NMSWithMask(PrimitiveWithInfer): >>> bbox = np.random.rand(128, 5) >>> bbox[:, 2] += bbox[:, 0] >>> bbox[:, 3] += bbox[:, 1] - >>> inputs = Tensor(bbox) + >>> inputs = Tensor(bbox, mindspore.float32) >>> nms = P.NMSWithMask(0.5) >>> output_boxes, indices, mask = nms(inputs) """