Added torchvision.transforms.v2.Transform.transform overrides to enable torchvision>=0.21 support
Several issues were complaining about a NotImplementedError raised by torchvision.transforms.v2.Transform.transform.
The reason of this issue is that torchvision>=0.21 renamed the method that needs to be overridden when creating a custom transform. (see https://pytorch.org/vision/stable/generated/torchvision.transforms.v2.Transform.html#torchvision.transforms.v2.Transform.transform )
To fix this issue without breaking the support of older torchvision versions, I simply duplicated the methods "_transform" of the custom transforms and renamed them "transform".
I found there are many "def _transform". did you mean that I should modify each of them under your guidance?
I found there are many "def _transform". did you mean that I should modify each of them under your guidance?
https://github.com/ShihuaHuang95/DEIM/pull/104 have more detail, see files changed ,just one file need to modify,and in torchvision 0.22.1 is ok