You have a typo in your code.
Use import torchvision.transforms as transforms instead of import torchvision.transform as transforms (note the additional s).
PS: it’s better to post code snippets by wrapping them into three backticks ```, as it makes debugging easier.