The method is not available in 0.2 http://pytorch.org/docs/0.2.0/torchvision/transforms.html 160. (note the version selector on top left of doc page.) It should be in 0.3 and master according to the doc.