Hi,
Im trying to combine a couple transforms together using torchvision.transforms.Compose but I get the error:

TypeError: batch must contain tensors, numbers, dicts or lists; found <class ‘torchvision.transforms.Compose’>

At first I wrote the transform as simple functions but after reading here: https://pytorch.org/tutorials/beginner/data_loading_tutorial.html#transforms 13 that they have to be callable objects for the Compose to work I rewrote them as callable classes but am still getting the error.
This is my line for Compose:
normalize = Normalize(mean, std)
random_flip = RandomFlip(random_state)
rotate_90 = RandomRotate90(num_rotate)
to_tensor = ToTensor(expand_dims=True, dtype=self.label_dtype)

img_transform = Compose([normalize(img),
                                 random_flip(img),
                                 rotate_90(img),
                                 to_tensor(img)
                                 ])

And here is Normalize
class Normalize:

    def __init__(self, mean, std, eps=1e-4):
        self.mean = mean
        self.std = std
        self.eps = eps

    def __call__(self, m):
        return (m - self.mean) / (self.std + self.eps)

Why is it not returning the images after transformations applied, rather than the Compose class?
Thanks