Add torchvision.ops.deform_conv2d and opset19-specific tests#2923
Add torchvision.ops.deform_conv2d and opset19-specific tests#2923f-fuchs wants to merge 6 commits into
torchvision.ops.deform_conv2d and opset19-specific tests#2923Conversation
…hvision_deform_conv2d with opset19
|
@microsoft-github-policy-service agree |
justinchuby
left a comment
There was a problem hiding this comment.
Thanks! For testing, I think you can instead add tests to the e2e file. This may be the simplest with regards to the opset situation
|
I reverted my test changes and added two tests to tests/function_libs/torch_lib/e2e_ops_tests.py. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2923 +/- ##
=======================================
Coverage 72.64% 72.64%
=======================================
Files 259 259
Lines 31652 31657 +5
Branches 2980 2980
=======================================
+ Hits 22994 22998 +4
- Misses 7649 7650 +1
Partials 1009 1009 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This PR adds ONNX export support for torchvision.ops.deform_conv2d by registering a torch-lib mapping to the ONNX DeformConv operator (opset 19) and adds end-to-end export tests exercising the new path.
Changes:
- Register
torchvision::deform_conv2din torch-lib and lower it toopset19.DeformConvwith stride/dilation/pad/group handling. - Add e2e
torch.onnx.export(..., opset_version=19, dynamo=True)tests for deform-conv (basic + mask/padding/group coverage). - Update test module imports to include
torchvisionfor the new test cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/function_libs/torch_lib/e2e_ops_tests.py |
Adds opset-19 e2e export tests for torchvision.ops.deform_conv2d. |
onnxscript/function_libs/torch_lib/ops/vision.py |
Registers torchvision::deform_conv2d and maps it to ONNX DeformConv (opset 19). |
| input: TFloat, | ||
| weight: TFloat, | ||
| offset: TFloat, | ||
| mask: TFloat, | ||
| bias: TFloat, |
| @@ -11,7 +11,9 @@ | |||
| from typing import Sequence | |||
|
@f-fuchs could you follow the copilot review comments? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
117c463 to
dcc75b0
Compare
…onal in the docstring signature
done |
Summary
Add mapping for
torchvision.ops.deform_conv2dto ONNXDeformConvand add OpInfo-based test coverage.Changes
torchvision.ops.deform_conv2dsupport inonnxscript/function_libs/torch_lib/ops/vision.pypaddingto ONNXpadsgroupandoffset_groupbiasandmaskTests
Added OpInfo coverage for:
Files:
tests/function_libs/torch_lib/extra_opinfo.pytests/function_libs/torch_lib/ops_test_data.pyOpset handling
DeformConvrequires ONNX opset 19+, while the existing torch-lib full-graph suite uses opset 18.To keep the existing suite unchanged:
Files:
tests/function_libs/torch_lib/ops_test.pytests/function_libs/torch_lib/ops_test_common.pyValidation
Passed:
1 passed1 skipped(expected fortrace_only=True)