Merge pull request !8062 from lihongkang/v2_mastertags/v1.1.0
| @@ -3020,7 +3020,7 @@ class ScatterDiv(_ScatterOp): | |||||
| Examples: | Examples: | ||||
| >>> input_x = Parameter(Tensor(np.array([[6.0, 6.0, 6.0], [2.0, 2.0, 2.0]]), mindspore.float32), name="x") | >>> 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) | >>> 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() | >>> scatter_div = P.ScatterDiv() | ||||
| >>> output = scatter_div(input_x, indices, updates) | >>> output = scatter_div(input_x, indices, updates) | ||||
| [[3.0, 3.0, 3.0], [1.0, 1.0, 1.0]] | [[3.0, 3.0, 3.0], [1.0, 1.0, 1.0]] | ||||
| @@ -59,7 +59,7 @@ class CropAndResize(PrimitiveWithInfer): | |||||
| >>> super(CropAndResizeNet, self).__init__() | >>> super(CropAndResizeNet, self).__init__() | ||||
| >>> self.crop_and_resize = P.CropAndResize() | >>> self.crop_and_resize = P.CropAndResize() | ||||
| >>> self.crop_size = crop_size | >>> self.crop_size = crop_size | ||||
| >>> @ms_function | |||||
| >>> | |||||
| >>> def construct(self, x, boxes, box_index): | >>> def construct(self, x, boxes, box_index): | ||||
| >>> return self.crop_and_resize(x, boxes, box_index, self.crop_size) | >>> return self.crop_and_resize(x, boxes, box_index, self.crop_size) | ||||
| >>> | >>> | ||||
| @@ -74,7 +74,8 @@ class CropAndResize(PrimitiveWithInfer): | |||||
| >>> crop_size = (24, 24) | >>> crop_size = (24, 24) | ||||
| >>> crop_and_resize = CropAndResizeNet(crop_size=crop_size) | >>> crop_and_resize = CropAndResizeNet(crop_size=crop_size) | ||||
| >>> output = crop_and_resize(Tensor(image), Tensor(boxes), Tensor(box_index)) | >>> output = crop_and_resize(Tensor(image), Tensor(boxes), Tensor(box_index)) | ||||
| >>> print(output.asnumpy()) | |||||
| >>> output.shape | |||||
| (5, 24, 24, 3) | |||||
| """ | """ | ||||
| @prim_attr_register | @prim_attr_register | ||||