Merge pull request !4213 from fangzehua/resize_neartags/v0.7.0-beta
| @@ -177,8 +177,8 @@ from .lamb_update_with_lr import _lamb_update_with_lr_tbe | |||||
| from .rsqrt import _rsqrt_tbe | from .rsqrt import _rsqrt_tbe | ||||
| from .sigmoid import _sigmoid_tbe | from .sigmoid import _sigmoid_tbe | ||||
| from .sigmoid_grad import _sigmoid_grad_tbe | from .sigmoid_grad import _sigmoid_grad_tbe | ||||
| from .resize_nearest_neighbor_d import _resize_nearest_neighbor_d_tbe | |||||
| from .resize_nearest_neighbor_grad_d import _resize_nearest_neighbor_grad_d_tbe | |||||
| from .resize_nearest_neighbor import _resize_nearest_neighbor_tbe | |||||
| from .resize_nearest_neighbor_grad import _resize_nearest_neighbor_grad_tbe | |||||
| from .pad_d import _pad_d_tbe | from .pad_d import _pad_d_tbe | ||||
| from .arg_max_with_value import _arg_max_with_value_tbe | from .arg_max_with_value import _arg_max_with_value_tbe | ||||
| from .arg_min_with_value import _arg_min_with_value_tbe | from .arg_min_with_value import _arg_min_with_value_tbe | ||||
| @@ -27,20 +27,12 @@ resize_nearest_neighbor_op_info = TBERegOp("ResizeNearestNeighbor") \ | |||||
| .attr("align_corners", "optional", "bool", "all") \ | .attr("align_corners", "optional", "bool", "all") \ | ||||
| .input(0, "images", False, "required", "all") \ | .input(0, "images", False, "required", "all") \ | ||||
| .output(0, "y", True, "required", "all") \ | .output(0, "y", True, "required", "all") \ | ||||
| .dtype_format(DataType.I8_Default, DataType.I8_Default) \ | |||||
| .dtype_format(DataType.I8_5HD, DataType.I8_5HD) \ | |||||
| .dtype_format(DataType.U8_Default, DataType.U8_Default) \ | |||||
| .dtype_format(DataType.U8_5HD, DataType.U8_5HD) \ | |||||
| .dtype_format(DataType.I32_Default, DataType.I32_Default) \ | |||||
| .dtype_format(DataType.I32_5HD, DataType.I32_5HD) \ | |||||
| .dtype_format(DataType.F16_Default, DataType.F16_Default) \ | |||||
| .dtype_format(DataType.F16_5HD, DataType.F16_5HD) \ | .dtype_format(DataType.F16_5HD, DataType.F16_5HD) \ | ||||
| .dtype_format(DataType.F32_Default, DataType.F32_Default) \ | |||||
| .dtype_format(DataType.F32_5HD, DataType.F32_5HD) \ | .dtype_format(DataType.F32_5HD, DataType.F32_5HD) \ | ||||
| .get_op_info() | .get_op_info() | ||||
| @op_info_register(resize_nearest_neighbor_op_info) | @op_info_register(resize_nearest_neighbor_op_info) | ||||
| def _resize_nearest_neighbor_d_tbe(): | |||||
| def _resize_nearest_neighbor_tbe(): | |||||
| """ResizeNearestNeighbor TBE register""" | """ResizeNearestNeighbor TBE register""" | ||||
| return | return | ||||
| @@ -1,41 +0,0 @@ | |||||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||||
| # | |||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| # you may not use this file except in compliance with the License. | |||||
| # You may obtain a copy of the License at | |||||
| # | |||||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||||
| # | |||||
| # Unless required by applicable law or agreed to in writing, software | |||||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| # See the License for the specific language governing permissions and | |||||
| # limitations under the License. | |||||
| # ============================================================================ | |||||
| """ResizeNearestNeighbor op""" | |||||
| from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType | |||||
| resize_nearest_neighbor_d_op_info = TBERegOp("ResizeNearestNeighbor") \ | |||||
| .fusion_type("OPAQUE") \ | |||||
| .async_flag(False) \ | |||||
| .binfile_name("resize_nearest_neighbor_d.so") \ | |||||
| .compute_cost(10) \ | |||||
| .kernel_name("resize_nearest_neighbor_d") \ | |||||
| .partial_flag(True) \ | |||||
| .attr("size", "required", "listInt", "all") \ | |||||
| .attr("align_corners", "optional", "bool", "all") \ | |||||
| .input(0, "images", False, "required", "all") \ | |||||
| .output(0, "y", True, "required", "all") \ | |||||
| .dtype_format(DataType.I8_5HD, DataType.I8_5HD) \ | |||||
| .dtype_format(DataType.U8_5HD, DataType.U8_5HD) \ | |||||
| .dtype_format(DataType.I32_5HD, DataType.I32_5HD) \ | |||||
| .dtype_format(DataType.F16_5HD, DataType.F16_5HD) \ | |||||
| .dtype_format(DataType.F32_5HD, DataType.F32_5HD) \ | |||||
| .get_op_info() | |||||
| @op_info_register(resize_nearest_neighbor_d_op_info) | |||||
| def _resize_nearest_neighbor_d_tbe(): | |||||
| """ResizeNearestNeighbor TBE register""" | |||||
| return | |||||
| @@ -16,7 +16,7 @@ | |||||
| """ResizeNearestNeighborgrad op""" | """ResizeNearestNeighborgrad op""" | ||||
| from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType | from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType | ||||
| resize_nearest_neighbor_grad_d_op_info = TBERegOp("ResizeNearestNeighborGrad") \ | |||||
| resize_nearest_neighbor_grad_op_info = TBERegOp("ResizeNearestNeighborGrad") \ | |||||
| .fusion_type("OPAQUE") \ | .fusion_type("OPAQUE") \ | ||||
| .async_flag(False) \ | .async_flag(False) \ | ||||
| .binfile_name("resize_nearest_neighbor_grad_d.so") \ | .binfile_name("resize_nearest_neighbor_grad_d.so") \ | ||||
| @@ -31,7 +31,7 @@ resize_nearest_neighbor_grad_d_op_info = TBERegOp("ResizeNearestNeighborGrad") \ | |||||
| .get_op_info() | .get_op_info() | ||||
| @op_info_register(resize_nearest_neighbor_grad_d_op_info) | |||||
| def _resize_nearest_neighbor_grad_d_tbe(): | |||||
| @op_info_register(resize_nearest_neighbor_grad_op_info) | |||||
| def _resize_nearest_neighbor_grad_tbe(): | |||||
| """ResizeNearestNeighborGrad TBE register""" | """ResizeNearestNeighborGrad TBE register""" | ||||
| return | return | ||||
| @@ -75,8 +75,8 @@ class BoundingBoxEncode(PrimitiveWithInfer): | |||||
| stds (tuple): Stds for encoding bounding boxes calculation. Default: (1.0, 1.0, 1.0, 1.0). | stds (tuple): Stds for encoding bounding boxes calculation. Default: (1.0, 1.0, 1.0, 1.0). | ||||
| Inputs: | Inputs: | ||||
| - **anchor_box** (Tensor) - Anchor boxes. | |||||
| - **groundtruth_box** (Tensor) - Ground truth boxes. | |||||
| - **anchor_box** (Tensor) - Anchor boxes. The shape of anchor_box must be (n, 4). | |||||
| - **groundtruth_box** (Tensor) - Ground truth boxes. Which has the same shape with anchor_box. | |||||
| Outputs: | Outputs: | ||||
| Tensor, encoded bounding boxes. | Tensor, encoded bounding boxes. | ||||
| @@ -128,8 +128,8 @@ class BoundingBoxDecode(PrimitiveWithInfer): | |||||
| wh_ratio_clip (float): The limit of width and height ratio for decoding box calculation. Default: 0.016. | wh_ratio_clip (float): The limit of width and height ratio for decoding box calculation. Default: 0.016. | ||||
| Inputs: | Inputs: | ||||
| - **anchor_box** (Tensor) - Anchor boxes. | |||||
| - **deltas** (Tensor) - Delta of boxes. | |||||
| - **anchor_box** (Tensor) - Anchor boxes. The shape of anchor_box must be (n, 4). | |||||
| - **deltas** (Tensor) - Delta of boxes. Which has the same shape with anchor_box. | |||||
| Outputs: | Outputs: | ||||
| Tensor, decoded boxes. | Tensor, decoded boxes. | ||||