Skip to content

Commit ea9ff22

Browse files
authored
[BugFix] Upgrade vision's functional import (#948)
1 parent 5f6eccd commit ea9ff22

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

torchrl/envs/transforms/transforms.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434

3535
try:
3636
from torchvision.transforms.functional import center_crop
37-
from torchvision.transforms.functional_tensor import (
38-
resize,
39-
) # as of now resize is imported from torchvision
37+
38+
try:
39+
from torchvision.transforms.functional import resize
40+
except ImportError:
41+
from torchvision.transforms.functional_tensor import resize
4042

4143
_has_tv = True
4244
except ImportError:

0 commit comments

Comments
 (0)