-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
String parameter cannot be passed to torchvision.ops.deform_conv2d
#6394
Comments
Hi @dario-loi, thanks for raising this. I don't want to argue semantics but TorchVision quite explicitly declares that expected inputs for paddings is either an integer or a Tuple of ints: vision/torchvision/ops/deform_conv.py Lines 14 to 23 in 93c85bb
Currently it doesn't support strings ( |
Thank you for the response, Would the implementation of this enhancement require the rewriting of both CPU & CUDA kernels to take into account this padding in the same way that Can we get away with a call to I'm asking you this since I've seen that you're the one responsible for the implementation of the kernels and therefore you would have knowledge regarding the performance impact of complicating the padding in C++ vs calling |
@dario-loi This is a great question. Unfortunately I don't know the answer and we would probably need to dig deep on how the specific kernel is designed. I will need to find the bandwidth for such a thing as I'm a bit swamped at the moment. So if you continue work on this feature, keep in mind I might not be able to review or merge it.
Unfortunately this is not true. We did a major refactoring of the C++ codebase at one point, to ensure that there is proper encapsulation and that we follow the latest practices from Dispatcher. Though I tried to rewrite as little parts as possible during the refactoring, unfortunately Github was unable to understand this on the diff and thus when you git blame you see me as the Uber author of all kernels. That's far from truth. |
🐛 Describe the bug
Bug Explanation
The current implementation of
torchvision.ops.deform_conv2d
implicitly assumes that padding is passed as a tuple or an integer, this means that if the padding is passed as either "same" or "valid" then torchvision is going to parse it aspadding = ("same")
.Sample Code
Stacktrace
Versions
The text was updated successfully, but these errors were encountered: