From a6b99fcebdfb3381bd6db31b444888b7e808fa7c Mon Sep 17 00:00:00 2001 From: co63oc Date: Fri, 5 Apr 2024 15:02:25 +0800 Subject: [PATCH] Fix --- .../fluid/operators/detection/CMakeLists.txt | 8 -- .../operators/detection/iou_similarity_op.cc | 118 --------------- .../operators/detection/iou_similarity_op.cu | 19 --- .../operators/detection/iou_similarity_op.h | 134 ------------------ .../detection/iou_similarity_op_xpu.cc | 63 -------- paddle/phi/backends/xpu/xpu1_op_list.cc | 1 - paddle/phi/backends/xpu/xpu2_op_list.cc | 1 - test/legacy_test/test_iou_similarity_op.py | 101 ------------- test/xpu/test_iou_similarity_op_xpu.py | 131 ----------------- tools/parallel_UT_rule.py | 2 - tools/static_mode_white_list.py | 1 - 11 files changed, 579 deletions(-) delete mode 100644 paddle/fluid/operators/detection/iou_similarity_op.cc delete mode 100644 paddle/fluid/operators/detection/iou_similarity_op.cu delete mode 100644 paddle/fluid/operators/detection/iou_similarity_op.h delete mode 100644 paddle/fluid/operators/detection/iou_similarity_op_xpu.cc delete mode 100644 test/legacy_test/test_iou_similarity_op.py delete mode 100644 test/xpu/test_iou_similarity_op_xpu.py diff --git a/paddle/fluid/operators/detection/CMakeLists.txt b/paddle/fluid/operators/detection/CMakeLists.txt index c9bee1eb60705..c592749aad61b 100644 --- a/paddle/fluid/operators/detection/CMakeLists.txt +++ b/paddle/fluid/operators/detection/CMakeLists.txt @@ -31,14 +31,6 @@ endfunction() detection_library(density_prior_box_op SRCS density_prior_box_op.cc density_prior_box_op.cu) -if(WITH_XPU) - detection_library(iou_similarity_op SRCS iou_similarity_op.cc - iou_similarity_op_xpu.cc) -else() - detection_library(iou_similarity_op SRCS iou_similarity_op.cc - iou_similarity_op.cu) -endif() - detection_library(bipartite_match_op SRCS bipartite_match_op.cc) detection_library(mine_hard_examples_op SRCS mine_hard_examples_op.cc) detection_library(anchor_generator_op SRCS anchor_generator_op.cc diff --git a/paddle/fluid/operators/detection/iou_similarity_op.cc b/paddle/fluid/operators/detection/iou_similarity_op.cc deleted file mode 100644 index 0f2ac1c86d628..0000000000000 --- a/paddle/fluid/operators/detection/iou_similarity_op.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -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. */ - -#include "paddle/fluid/operators/detection/iou_similarity_op.h" - -namespace paddle { -namespace operators { - -class IOUSimilarityOp : public framework::OperatorWithKernel { - public: - using framework::OperatorWithKernel::OperatorWithKernel; - - protected: - void InferShape(framework::InferShapeContext *ctx) const override { - OP_INOUT_CHECK(ctx->HasInput("X"), "Input", "X", "iou_similarity"); - OP_INOUT_CHECK(ctx->HasInput("Y"), "Input", "Y", "iou_similarity"); - auto x_dims = ctx->GetInputDim("X"); - auto y_dims = ctx->GetInputDim("Y"); - - PADDLE_ENFORCE_EQ( - x_dims.size(), - 2UL, - platform::errors::InvalidArgument( - "The rank of Input(X) must be 2, but got dimension = %d.", - x_dims.size())); - PADDLE_ENFORCE_EQ( - x_dims[1], - 4UL, - platform::errors::InvalidArgument( - "The shape of X is [N, 4], bug got dimension = %d.", x_dims[1])); - PADDLE_ENFORCE_EQ( - y_dims.size(), - 2UL, - platform::errors::InvalidArgument( - "The rank of Input(Y) must be 2, but got dimension = %d.", - y_dims.size())); - PADDLE_ENFORCE_EQ( - y_dims[1], - 4UL, - platform::errors::InvalidArgument( - "The shape of Y is [M, 4], but got dimension = %d.", y_dims[1])); - - ctx->ShareLoD("X", /*->*/ "Out"); - ctx->SetOutputDim("Out", common::make_ddim({x_dims[0], y_dims[0]})); - } -}; - -class IOUSimilarityOpMaker : public framework::OpProtoAndCheckerMaker { - public: - void Make() override { - AddInput( - "X", - "(phi::DenseTensor, default phi::DenseTensor) " - "Box list X is a 2-D phi::DenseTensor with shape [N, 4] holds N boxes, " - "each box is represented as [xmin, ymin, xmax, ymax], " - "the shape of X is [N, 4]. [xmin, ymin] is the left top " - "coordinate of the box if the input is image feature map, they " - "are close to the origin of the coordinate system. " - "[xmax, ymax] is the right bottom coordinate of the box. " - "This tensor can contain LoD information to represent a batch " - "of inputs. One instance of this batch can contain different " - "numbers of entities."); - AddInput("Y", - "(Tensor, default Tensor) " - "Box list Y holds M boxes, each box is represented as " - "[xmin, ymin, xmax, ymax], the shape of X is [N, 4]. " - "[xmin, ymin] is the left top coordinate of the box if the " - "input is image feature map, and [xmax, ymax] is the right " - "bottom coordinate of the box."); - AddAttr("box_normalized", - "(bool, default true) " - "whether treat the priorbox as a normalized box") - .SetDefault(true); - AddOutput("Out", - "(phi::DenseTensor, the lod is same as input X) The output of " - "iou_similarity op, a tensor with shape [N, M] " - "representing pairwise iou scores."); - - AddComment(R"DOC( -**IOU Similarity Operator** - -Computes intersection-over-union (IOU) between two box lists. -Box list 'X' should be a phi::DenseTensor and 'Y' is a common Tensor, -boxes in 'Y' are shared by all instance of the batched inputs of X. -Given two boxes A and B, the calculation of IOU is as follows: - -$$ -IOU(A, B) = -\\frac{area(A\\cap B)}{area(A)+area(B)-area(A\\cap B)} -$$ - -)DOC"); - } -}; -} // namespace operators -} // namespace paddle - -namespace ops = paddle::operators; -REGISTER_OPERATOR( - iou_similarity, - ops::IOUSimilarityOp, - ops::IOUSimilarityOpMaker, - paddle::framework::EmptyGradOpMaker, - paddle::framework::EmptyGradOpMaker); - -PD_REGISTER_STRUCT_KERNEL( - iou_similarity, CPU, ALL_LAYOUT, ops::IOUSimilarityKernel, float, double) {} diff --git a/paddle/fluid/operators/detection/iou_similarity_op.cu b/paddle/fluid/operators/detection/iou_similarity_op.cu deleted file mode 100644 index e4e001e096558..0000000000000 --- a/paddle/fluid/operators/detection/iou_similarity_op.cu +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -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. */ - -#include "paddle/fluid/operators/detection/iou_similarity_op.h" - -namespace ops = paddle::operators; -PD_REGISTER_STRUCT_KERNEL( - iou_similarity, GPU, ALL_LAYOUT, ops::IOUSimilarityKernel, float, double) {} diff --git a/paddle/fluid/operators/detection/iou_similarity_op.h b/paddle/fluid/operators/detection/iou_similarity_op.h deleted file mode 100644 index 75e7b9096241a..0000000000000 --- a/paddle/fluid/operators/detection/iou_similarity_op.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -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. */ - -#pragma once -#include "paddle/fluid/framework/op_registry.h" -#include "paddle/fluid/platform/for_range.h" - -template -inline HOSTDEVICE T IOUSimilarity(T xmin1, - T ymin1, - T xmax1, - T ymax1, - T xmin2, - T ymin2, - T xmax2, - T ymax2, - bool normalized, - T eps) { - constexpr T zero = static_cast(0); - T area1; - T area2; - if (!normalized) { - area1 = (ymax1 - ymin1 + 1) * (xmax1 - xmin1 + 1); - area2 = (ymax2 - ymin2 + 1) * (xmax2 - xmin2 + 1); - } else { - area1 = (ymax1 - ymin1) * (xmax1 - xmin1); - area2 = (ymax2 - ymin2) * (xmax2 - xmin2); - } - - T inter_xmax = xmax1 > xmax2 ? xmax2 : xmax1; - T inter_ymax = ymax1 > ymax2 ? ymax2 : ymax1; - T inter_xmin = xmin1 > xmin2 ? xmin1 : xmin2; - T inter_ymin = ymin1 > ymin2 ? ymin1 : ymin2; - T inter_height = inter_ymax - inter_ymin; - T inter_width = inter_xmax - inter_xmin; - if (!normalized) { - inter_height = inter_height + 1; - inter_width = inter_width + 1; - } - inter_height = inter_height > zero ? inter_height : zero; - inter_width = inter_width > zero ? inter_width : zero; - T inter_area = inter_width * inter_height; - T union_area = area1 + area2 - inter_area + eps; - T sim_score = inter_area / union_area; - return sim_score; -} - -template -struct IOUSimilarityFunctor { - IOUSimilarityFunctor( - const T* x, const T* y, T* z, int cols, bool normalized, T eps) - : x_(x), - y_(y), - z_(z), - cols_(static_cast(cols)), - normalized_(normalized), - eps_(eps) {} - - inline HOSTDEVICE void operator()(size_t tid) const { - size_t row_id = tid / cols_; - size_t col_id = tid % cols_; - - T x_min1 = x_[row_id * 4]; - T y_min1 = x_[row_id * 4 + 1]; - T x_max1 = x_[row_id * 4 + 2]; - T y_max1 = x_[row_id * 4 + 3]; - - T x_min2 = y_[col_id * 4]; - T y_min2 = y_[col_id * 4 + 1]; - T x_max2 = y_[col_id * 4 + 2]; - T y_max2 = y_[col_id * 4 + 3]; - - T sim = IOUSimilarity(x_min1, - y_min1, - x_max1, - y_max1, - x_min2, - y_min2, - x_max2, - y_max2, - normalized_, - eps_); - - z_[row_id * cols_ + col_id] = sim; - } - const T* x_; - const T* y_; - T* z_; - const size_t cols_; - bool normalized_; - T eps_; -}; - -namespace paddle { -namespace operators { - -template -class IOUSimilarityKernel : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext& ctx) const override { - const phi::DenseTensor* in_x = ctx.Input("X"); - const phi::DenseTensor* in_y = ctx.Input("Y"); - bool normalized = ctx.Attr("box_normalized"); - phi::DenseTensor* out = ctx.Output("Out"); - - int x_n = in_x->dims()[0]; - int y_n = in_y->dims()[0]; - T eps = static_cast(1e-10); - IOUSimilarityFunctor functor(in_x->data(), - in_y->data(), - out->mutable_data(ctx.GetPlace()), - y_n, - normalized, - eps); - - platform::ForRange for_range( - static_cast(ctx.device_context()), x_n * y_n); - for_range(functor); - } -}; // namespace operators - -} // namespace operators -} // namespace paddle diff --git a/paddle/fluid/operators/detection/iou_similarity_op_xpu.cc b/paddle/fluid/operators/detection/iou_similarity_op_xpu.cc deleted file mode 100644 index 27ffa64c2a892..0000000000000 --- a/paddle/fluid/operators/detection/iou_similarity_op_xpu.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -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. */ - -#ifdef PADDLE_WITH_XPU - -#include "paddle/fluid/operators/detection/iou_similarity_op.h" - -namespace paddle { -namespace operators { - -template -class XPUIOUSimilarityKernel : public framework::OpKernel { - public: - void Compute(const framework::ExecutionContext& ctx) const override { - const phi::DenseTensor* in_x = ctx.Input("X"); - const phi::DenseTensor* in_y = ctx.Input("Y"); - bool normalized = ctx.Attr("box_normalized"); - phi::DenseTensor* out = ctx.Output("Out"); - - int x_n = in_x->dims()[0]; - int y_n = in_y->dims()[0]; - T eps = static_cast(1e-10); - - auto& dev_ctx = ctx.template device_context(); - int r = xpu::iou_similarity(dev_ctx.x_context(), - in_x->data(), - in_y->data(), - out->mutable_data(ctx.GetPlace()), - x_n, - y_n, - eps, - normalized); - PADDLE_ENFORCE_EQ( - r, - XPU_SUCCESS, - platform::errors::External( - "XPU iou_similarity kernel return wrong value[%d %s].", - r, - XPUAPIErrorMsg[r])); - } -}; - -} // namespace operators -} // namespace paddle - -namespace ops = paddle::operators; -using XPU = paddle::platform::XPUDeviceContext; - -PD_REGISTER_STRUCT_KERNEL( - iou_similarity, XPU, ALL_LAYOUT, ops::XPUIOUSimilarityKernel, float) {} - -#endif diff --git a/paddle/phi/backends/xpu/xpu1_op_list.cc b/paddle/phi/backends/xpu/xpu1_op_list.cc index cef49d14c076f..29484d43867c2 100644 --- a/paddle/phi/backends/xpu/xpu1_op_list.cc +++ b/paddle/phi/backends/xpu/xpu1_op_list.cc @@ -160,7 +160,6 @@ XPUOpMap& get_kl1_ops() { XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::INT32, phi::DataType::INT64})}, - {"iou_similarity", XPUKernelSet({phi::DataType::FLOAT32})}, {"lamb", XPUKernelSet({phi::DataType::FLOAT32})}, {"layer_norm_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"layer_norm", XPUKernelSet({phi::DataType::FLOAT32})}, diff --git a/paddle/phi/backends/xpu/xpu2_op_list.cc b/paddle/phi/backends/xpu/xpu2_op_list.cc index 07972469a32b1..182d33319906b 100644 --- a/paddle/phi/backends/xpu/xpu2_op_list.cc +++ b/paddle/phi/backends/xpu/xpu2_op_list.cc @@ -586,7 +586,6 @@ XPUOpMap& get_kl2_ops() { {"instance_norm_grad", XPUKernelSet({phi::DataType::FLOAT32})}, {"inverse", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT64})}, - {"iou_similarity", XPUKernelSet({phi::DataType::FLOAT32})}, {"label_smooth", XPUKernelSet({phi::DataType::FLOAT32})}, {"lamb", XPUKernelSet({phi::DataType::FLOAT32, phi::DataType::FLOAT16})}, {"lars_momentum", diff --git a/test/legacy_test/test_iou_similarity_op.py b/test/legacy_test/test_iou_similarity_op.py deleted file mode 100644 index 974bd0b362ada..0000000000000 --- a/test/legacy_test/test_iou_similarity_op.py +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. -# -# 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. - -import unittest - -from numpy import random -from op_test import OpTest - - -class TestIOUSimilarityOp(OpTest): - def test_check_output(self): - self.check_output(check_dygraph=False) - - def setUp(self): - self.op_type = "iou_similarity" - self.boxes1 = random.rand(2, 4).astype('float32') - self.boxes2 = random.rand(3, 4).astype('float32') - self.output = random.rand(2, 3).astype('float32') - self.box_normalized = False - # run python iou computation - self._compute_iou() - self.inputs = {'X': self.boxes1, 'Y': self.boxes2} - self.attrs = {"box_normalized": self.box_normalized} - self.outputs = {'Out': self.output} - - def _compute_iou( - self, - ): - for row in range(self.boxes1.shape[0]): - for col in range(self.boxes2.shape[0]): - xmin1, ymin1, xmax1, ymax1 = self.boxes1[row] - xmin2, ymin2, xmax2, ymax2 = self.boxes2[col] - if not self.box_normalized: - area1 = (ymax1 - ymin1 + 1) * (xmax1 - xmin1 + 1) - area2 = (ymax2 - ymin2 + 1) * (xmax2 - xmin2 + 1) - else: - area1 = (ymax1 - ymin1) * (xmax1 - xmin1) - area2 = (ymax2 - ymin2) * (xmax2 - xmin2) - - inter_xmax = min(xmax1, xmax2) - inter_ymax = min(ymax1, ymax2) - inter_xmin = max(xmin1, xmin2) - inter_ymin = max(ymin1, ymin2) - inter_height = inter_ymax - inter_ymin - inter_width = inter_xmax - inter_xmin - if not self.box_normalized: - inter_height += 1 - inter_width += 1 - inter_height = max(inter_height, 0) - inter_width = max(inter_width, 0) - inter_area = inter_width * inter_height - union_area = area1 + area2 - inter_area - sim_score = inter_area / union_area - self.output[row, col] = sim_score - - -class TestIOUSimilarityOpWithLoD(TestIOUSimilarityOp): - def test_check_output(self): - self.check_output(check_dygraph=False) - - def setUp(self): - super().setUp() - self.boxes1_lod = [[1, 1]] - self.output_lod = [[1, 1]] - self.box_normalized = False - # run python iou computation - self._compute_iou() - self.inputs = {'X': (self.boxes1, self.boxes1_lod), 'Y': self.boxes2} - self.attrs = {"box_normalized": self.box_normalized} - self.outputs = {'Out': (self.output, self.output_lod)} - - -class TestIOUSimilarityOpWithBoxNormalized(TestIOUSimilarityOp): - def test_check_output(self): - self.check_output(check_dygraph=False) - - def setUp(self): - super().setUp() - self.boxes1_lod = [[1, 1]] - self.output_lod = [[1, 1]] - self.box_normalized = True - # run python iou computation - self._compute_iou() - self.inputs = {'X': (self.boxes1, self.boxes1_lod), 'Y': self.boxes2} - self.attrs = {"box_normalized": self.box_normalized} - self.outputs = {'Out': (self.output, self.output_lod)} - - -if __name__ == '__main__': - unittest.main() diff --git a/test/xpu/test_iou_similarity_op_xpu.py b/test/xpu/test_iou_similarity_op_xpu.py deleted file mode 100644 index 301d5fb07b99a..0000000000000 --- a/test/xpu/test_iou_similarity_op_xpu.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. -# -# 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. - -import unittest - -from get_test_cover_info import ( - XPUOpTestWrapper, - create_test_class, - get_xpu_op_support_types, -) -from numpy import random -from op_test_xpu import XPUOpTest - -import paddle - -paddle.enable_static() - - -class XPUTestIOUSimilarityOp(XPUOpTestWrapper): - def __init__(self): - self.op_name = 'iou_similarity' - self.use_dynamic_create_class = False - - class TestXPUIOUSimilarityOp(XPUOpTest): - def init(self): - self.dtype = self.in_type - self.place = paddle.XPUPlace(0) - self.op_type = 'iou_similarity' - - def test_check_output(self): - self.check_output_with_place(self.place) - - def setUp(self): - self.init() - self.boxes1 = random.rand(2, 4).astype(self.dtype) - self.boxes2 = random.rand(3, 4).astype(self.dtype) - self.output = random.rand(2, 3).astype(self.dtype) - self.box_normalized = False - # run python iou computation - self._compute_iou() - self.inputs = {'X': self.boxes1, 'Y': self.boxes2} - self.attrs = { - "box_normalized": self.box_normalized, - 'use_xpu': True, - } - self.outputs = {'Out': self.output} - - def _compute_iou( - self, - ): - for row in range(self.boxes1.shape[0]): - for col in range(self.boxes2.shape[0]): - xmin1, ymin1, xmax1, ymax1 = self.boxes1[row] - xmin2, ymin2, xmax2, ymax2 = self.boxes2[col] - if not self.box_normalized: - area1 = (ymax1 - ymin1 + 1) * (xmax1 - xmin1 + 1) - area2 = (ymax2 - ymin2 + 1) * (xmax2 - xmin2 + 1) - else: - area1 = (ymax1 - ymin1) * (xmax1 - xmin1) - area2 = (ymax2 - ymin2) * (xmax2 - xmin2) - - inter_xmax = min(xmax1, xmax2) - inter_ymax = min(ymax1, ymax2) - inter_xmin = max(xmin1, xmin2) - inter_ymin = max(ymin1, ymin2) - inter_height = inter_ymax - inter_ymin - inter_width = inter_xmax - inter_xmin - if not self.box_normalized: - inter_height += 1 - inter_width += 1 - inter_height = max(inter_height, 0) - inter_width = max(inter_width, 0) - inter_area = inter_width * inter_height - union_area = area1 + area2 - inter_area - sim_score = inter_area / union_area - self.output[row, col] = sim_score - - class TestXPUIOUSimilarityOpWithLoD(TestXPUIOUSimilarityOp): - def test_check_output(self): - self.check_output_with_place(self.place, check_dygraph=False) - - def setUp(self): - super().setUp() - self.boxes1_lod = [[1, 1]] - self.output_lod = [[1, 1]] - self.box_normalized = False - # run python iou computation - self._compute_iou() - self.inputs = { - 'X': (self.boxes1, self.boxes1_lod), - 'Y': self.boxes2, - } - self.attrs = {"box_normalized": self.box_normalized} - self.outputs = {'Out': (self.output, self.output_lod)} - - class TestXPUIOUSimilarityOpWithBoxNormalized(TestXPUIOUSimilarityOp): - def test_check_output(self): - self.check_output_with_place(self.place, check_dygraph=False) - - def setUp(self): - super().setUp() - self.boxes1_lod = [[1, 1]] - self.output_lod = [[1, 1]] - self.box_normalized = True - # run python iou computation - self._compute_iou() - self.inputs = { - 'X': (self.boxes1, self.boxes1_lod), - 'Y': self.boxes2, - } - self.attrs = {"box_normalized": self.box_normalized} - self.outputs = {'Out': (self.output, self.output_lod)} - - -support_types = get_xpu_op_support_types('iou_similarity') -for stype in support_types: - create_test_class(globals(), XPUTestIOUSimilarityOp, stype) - -if __name__ == '__main__': - unittest.main() diff --git a/tools/parallel_UT_rule.py b/tools/parallel_UT_rule.py index 8c618debbeb21..749af910e4d51 100755 --- a/tools/parallel_UT_rule.py +++ b/tools/parallel_UT_rule.py @@ -1079,7 +1079,6 @@ 'test_deprecated_decorator', 'test_complex_cast', 'test_diag_v2', - 'test_iou_similarity_op', 'test_inplace_auto_generated_apis', 'test_dataset', 'test_bilinear_api', @@ -2804,7 +2803,6 @@ 'test_tensor_array_to_tensor', 'test_mean_op', 'test_momentum_op', - 'test_iou_similarity_op', 'test_optimizer_grad', 'test_dygraph_weight_norm', 'test_batch_norm_op_v2', diff --git a/tools/static_mode_white_list.py b/tools/static_mode_white_list.py index 48f7178fa23dc..e65501d820fc9 100755 --- a/tools/static_mode_white_list.py +++ b/tools/static_mode_white_list.py @@ -279,7 +279,6 @@ 'test_instance_norm_op_v2', 'test_inverse_op', 'test_io_save_load', - 'test_iou_similarity_op', 'test_ir_memory_optimize_pass', 'test_kldiv_loss_op', 'test_kron_op',