Skip to content

Commit 2a12f5d

Browse files
committed
Add deform conv2d op
1 parent 377ead8 commit 2a12f5d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle2onnx/mapper/nn/deform_conv2d.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ namespace paddle2onnx
3333
auto offset_info = GetInput("Offset");
3434
auto mask_info = GetInput("Mask");
3535
auto output_info = GetOutput("Output");
36+
std::vector<int64_t> bias_shape;
37+
bias_shape.emplace_back(kernel_info[0].shape[0]);
38+
std::string bias_name = helper_->Constant(bias_shape, GetOnnxDtype(P2ODataType::FP32), static_cast<float>(1.0));
3639
auto node = helper_->MakeNode(
37-
"DeformConv", {input_info[0].name, kernel_info[0].name, offset_info[0].name}, {output_info[0].name});
40+
"DeformConv", {input_info[0].name, kernel_info[0].name, offset_info[0].name, bias_name, mask_info[0].name}, {output_info[0].name});
3841

3942
AddAttribute(node, "dilations", dilations_);
4043
AddAttribute(node, "group", groups_);

0 commit comments

Comments
 (0)