Check your torchvision install version. The method should be in 0.3 torchvision.
Btw, as an reminder, when such error happens, be sure to check doc of the correct version. The one you linked is master, rather than 0.3. That said, the method should be in 0.3 as well.