Skip to content

Commit f45d714

Browse files
committed
Fix jit-scriptability
1 parent 6fa35f1 commit f45d714

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

torchvision/transforms/_presets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ def forward(self, vid: Tensor) -> Tensor:
108108

109109
_, T, C, H, W = vid.shape # (N, T, C, H, W)
110110
vid = vid.view(-1, C, H, W)
111-
if self.resize_size:
111+
if self.resize_size is not None:
112112
vid = F.resize(vid, self.resize_size, interpolation=self.interpolation)
113-
if self.crop_size:
113+
if self.crop_size is not None:
114114
if self.crop_mode == "center_crop":
115115
vid = F.center_crop(vid, self.crop_size)
116116
else:
117117
crops = (
118-
F.five_crop(vid, self.crop_size)
118+
list(F.five_crop(vid, self.crop_size))
119119
if self.crop_mode == "five_crop"
120-
else F.ten_crop(vid, self.crop_size)
120+
else list(F.ten_crop(vid, self.crop_size))
121121
)
122122
vid = torch.cat(crops)
123123
vid = F.convert_image_dtype(vid, torch.float)

0 commit comments

Comments
 (0)