We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8f6edf commit 65d7a85Copy full SHA for 65d7a85
torchvision/transforms/transforms.py
@@ -705,7 +705,9 @@ def forward(self, img):
705
706
fill = self.fill
707
if isinstance(img, Tensor):
708
- if isinstance(fill, (int, float)):
+ if fill is None:
709
+ fill = [.0] * F._get_image_num_channels(img)
710
+ elif isinstance(fill, (int, float)):
711
fill = [float(fill)] * F._get_image_num_channels(img)
712
else:
713
fill = [float(f) for f in fill]
@@ -1390,7 +1392,9 @@ def forward(self, img):
1390
1392
"""
1391
1393
1394
1395
1396
1397
1398
1399
1400
0 commit comments