Is there a way to apply transforms.ToPILImage with nn.Sequential e.g,
tranform_lst=[transforms.ToPILImage(),
transforms.RandomHorizontalFlip(),
transforms.ToTensor()]
transforms_func = torch.nn.Sequential(*tranform_lst)

I wanna use a batch-wise transform in the training loop, and my inputs are torch tensors. hence there is a need to convert to PIL and back to tensor.
thanks!