@moreshud Since torchvision v0.8.x can work on tensors directly, thus you can perform the following
import torch
from torchvision import transforms

M = torch.randint(low=0, high=2, size=(6, 64, 64), dtype = torch.float)

gt_trans = transforms.Compose([
    transforms.Resize((32, 32)),
])
print(M.shape)
print(gt_trans(M).shape)
> torch.Size([6, 64, 64])
> torch.Size([6, 32, 32])