Browse Source

!8062 fix bugs of op ScatterDiv and CropAndResize

Merge pull request !8062 from lihongkang/v2_master
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
7dd3535cf2
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      mindspore/ops/operations/array_ops.py
  2. +3
    -2
      mindspore/ops/operations/image_ops.py

+ 1
- 1
mindspore/ops/operations/array_ops.py View File

@@ -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]]


+ 3
- 2
mindspore/ops/operations/image_ops.py View File

@@ -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


Loading…
Cancel
Save