From 7637da4d0241f4ba3432a3d8a9696050dd3749b2 Mon Sep 17 00:00:00 2001 From: lihongkang <[lihongkang1@huawei.com]> Date: Sat, 31 Oct 2020 10:22:28 +0800 Subject: [PATCH] fix bugs --- mindspore/ops/operations/array_ops.py | 2 +- mindspore/ops/operations/image_ops.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index de98f8f785..3cb0979cec 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -3020,7 +3020,7 @@ class ScatterDiv(_ScatterOp): Examples: >>> input_x = Parameter(Tensor(np.array([[6.0, 6.0, 6.0], [2.0, 2.0, 2.0]]), mindspore.float32), name="x") >>> indices = Tensor(np.array([0, 1]), mindspore.int32) - >>> updates = Tensor(np.ones([[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]), mindspore.float32) + >>> updates = Tensor(np.array([[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]), mindspore.float32) >>> scatter_div = P.ScatterDiv() >>> output = scatter_div(input_x, indices, updates) [[3.0, 3.0, 3.0], [1.0, 1.0, 1.0]] diff --git a/mindspore/ops/operations/image_ops.py b/mindspore/ops/operations/image_ops.py index 0efdc30c94..3041508daa 100644 --- a/mindspore/ops/operations/image_ops.py +++ b/mindspore/ops/operations/image_ops.py @@ -59,7 +59,7 @@ class CropAndResize(PrimitiveWithInfer): >>> super(CropAndResizeNet, self).__init__() >>> self.crop_and_resize = P.CropAndResize() >>> self.crop_size = crop_size - >>> @ms_function + >>> >>> def construct(self, x, boxes, box_index): >>> return self.crop_and_resize(x, boxes, box_index, self.crop_size) >>> @@ -74,7 +74,8 @@ class CropAndResize(PrimitiveWithInfer): >>> crop_size = (24, 24) >>> crop_and_resize = CropAndResizeNet(crop_size=crop_size) >>> output = crop_and_resize(Tensor(image), Tensor(boxes), Tensor(box_index)) - >>> print(output.asnumpy()) + >>> output.shape + (5, 24, 24, 3) """ @prim_attr_register