From 77f3159aa12c0c2c167b09b1c4c6939567a986b1 Mon Sep 17 00:00:00 2001 From: vmoens Date: Fri, 3 Mar 2023 15:39:19 +0000 Subject: [PATCH] init --- torchrl/envs/transforms/transforms.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/torchrl/envs/transforms/transforms.py b/torchrl/envs/transforms/transforms.py index 82d60f946a3..12af5d58eb8 100644 --- a/torchrl/envs/transforms/transforms.py +++ b/torchrl/envs/transforms/transforms.py @@ -34,9 +34,11 @@ try: from torchvision.transforms.functional import center_crop - from torchvision.transforms.functional_tensor import ( - resize, - ) # as of now resize is imported from torchvision + + try: + from torchvision.transforms.functional import resize + except ImportError: + from torchvision.transforms.functional_tensor import resize _has_tv = True except ImportError: