You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sounds reasonable but note we are limited due to JIT compatibility. We wound't be able to add for example numpy arrays in the check because that won't be JIT-scritable. We need to review what exactly is supported by JIT and what's the common denominator/type for iterable objects.
@pmeier@vfdev-5 Good feedback for the new API. Perhaps we could push all these checks on the non-JIT-scriptable high-level kernels and allow the low-level ones just work on input with minimal validation. Thoughts?
Given that we do not plan to make the transforms (objects not kernels) JIT scriptable, I think we should be able to fix the annotations on the transforms.
🚀 The feature
Replace all checks for (list,tuple) in functional with Iterable.
Motivation, pitch
There are about 8 checks in functional right now which requires the argument to be either list or tuple, e.g.
https://github.com/pytorch/vision/blob/main/torchvision/transforms/functional.py#L1059
Instead of performing these checks, simply checking for Iterable allows to use e.g. numpy arrays.
In my usecase i generate parameters using numpy, and I don't want to convert them.
The documentation indicates that general sequences should work, so the current checks are counter-intuitive.
Alternatives
No response
Additional context
No response
cc @vfdev-5 @datumbox
The text was updated successfully, but these errors were encountered: