Update test_transforms.py (#500)
Improve `test_pad_with_non_constant_padding_modes` to avoid data multiplication in `transforms.ToPILImage()` on float data: ```python img = torch.zeros(3, 27, 27) # Float32 img[:, :, 0] = 1 # we add 1 and not 255 img = transforms.ToPILImage()(img) # This converts 1 to 255 due to [pic = pic.mul(255).byte()](https://github.com/pytorch/vision/blob/master/torchvision/transforms/functional.py#L107) ``` and thus test's correct values are [..., 200, 1, 0]
Showing
Please register or sign in to comment