Error with torch on jetson

I am using pytorch on a jetson device. Here are the versions:
torch: 2.1.0a0+41361538.nv23.06
torchvision: 0.16.1

I am using this piece of code to resize my images.

transform = v2.Compose([
    v2.Resize((224, 224), interpolation=v2.InterpolationMode.BILINEAR)
])

I am getting the following error:
AttributeError: module ‘torch.backends’ has no attribute ‘cpu’

Can someone help me fix this? Thanks a lot

Your torchvision release might be too new so build an older and compatible one.

Okay, thank you, I will try building 0.15.