Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add autogen code support for matrix_nms. #52479

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion paddle/fluid/operators/detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ detection_library(generate_proposal_labels_op SRCS
generate_proposal_labels_op.cc)
detection_library(multiclass_nms_op SRCS multiclass_nms_op.cc DEPS gpc)
detection_library(locality_aware_nms_op SRCS locality_aware_nms_op.cc DEPS gpc)
detection_library(matrix_nms_op SRCS matrix_nms_op.cc DEPS gpc)
detection_library(box_clip_op SRCS box_clip_op.cc box_clip_op.cu)
detection_library(yolov3_loss_op SRCS yolov3_loss_op.cc)
detection_library(box_decoder_and_assign_op SRCS box_decoder_and_assign_op.cc
Expand Down
146 changes: 0 additions & 146 deletions paddle/fluid/operators/detection/matrix_nms_op.cc

This file was deleted.

7 changes: 7 additions & 0 deletions paddle/fluid/operators/generator/get_expected_kernel_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,12 @@ phi::KernelKey GetUpdateLossScalingExpectedKernelType(
return phi::KernelKey(dtype, ctx.GetPlace());
}

phi::KernelKey GetMatrixNmsExpectedKernelType(
const framework::ExecutionContext& ctx,
const framework::OperatorWithKernel* op_ptr) {
return phi::KernelKey(op_ptr->IndicateVarDataType(ctx, "Scores"),
platform::CPUPlace());
}

} // namespace operators
} // namespace paddle
4 changes: 4 additions & 0 deletions paddle/fluid/operators/generator/get_expected_kernel_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ phi::KernelKey GetUpdateLossScalingExpectedKernelType(
const framework::ExecutionContext& ctx,
const framework::OperatorWithKernel* op_ptr);

phi::KernelKey GetMatrixNmsExpectedKernelType(
const framework::ExecutionContext& ctx,
const framework::OperatorWithKernel* op_ptr);

} // namespace operators
} // namespace paddle
8 changes: 0 additions & 8 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -935,14 +935,6 @@
func : matmul
backward : matmul_grad

- op : matrix_nms
args : (Tensor bboxes, Tensor scores, float score_threshold, int nms_top_k, int keep_top_k, float post_threshold=0., bool use_gaussian = false, float gaussian_sigma = 2.0, int background_label = 0, bool normalized = true)
output : Tensor(out), Tensor(index), Tensor(roisnum)
infer_meta :
func : MatrixNMSInferMeta
kernel :
func : matrix_nms

- op : matrix_rank
args : (Tensor x, float tol, bool hermitian=false, bool use_default_tol=true)
output : Tensor(out)
Expand Down
8 changes: 8 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,14 @@
attrs : [bool use_mkldnn = false, float scale_x = 1.0f, 'float[] scale_y = {1.0f}',
float scale_out = 1.0f, bool force_fp32_output = false]

- op : matrix_nms
inputs :
{bboxes : BBoxes, scores : Scores}
outputs :
{out : Out, index : Index, roisnum : RoisNum}
ScottWong98 marked this conversation as resolved.
Show resolved Hide resolved
get_expected_kernel_type :
matrix_nms : GetMatrixNmsExpectedKernelType

- op : matrix_power
inputs :
x : X
Expand Down
7 changes: 7 additions & 0 deletions paddle/phi/api/yaml/op_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@
comment : In order to change output data type
default : 5

- op : matrix_nms
version :
- checkpoint : Upgrade matrix_nms, add a new output [RoisNum].
action :
- add_output : RoisNum
comment : The number of RoIs in each image.

- op : not_equal
version :
- checkpoint : Upgrade compare ops, add a new attribute [force_cpu]
Expand Down
9 changes: 9 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,15 @@
data_type : x
backward : masked_select_grad

- op : matrix_nms
args : (Tensor bboxes, Tensor scores, float score_threshold, int nms_top_k, int keep_top_k, float post_threshold=0., bool use_gaussian = false, float gaussian_sigma = 2., int background_label = 0, bool normalized = true)
output : Tensor(out), Tensor(index), Tensor(roisnum)
infer_meta :
ScottWong98 marked this conversation as resolved.
Show resolved Hide resolved
func : MatrixNMSInferMeta
optional : roisnum
kernel :
func : matrix_nms

- op : matrix_power
args : (Tensor x, int n)
output : Tensor
Expand Down
35 changes: 0 additions & 35 deletions paddle/phi/ops/compat/matrix_nms_sig.cc

This file was deleted.