Expand dimension

Hi, I want to expand dimension while doing transforming, like trans = transforms.Compose([transforms.ToTensor(), Expand_dims(trans, dim(1)])? Is there some function that Pytorch support in transforms?

Do that expand dims to the transformed output using reshape or view.

I’m using

transforms.Lambda(lambda x: torch.unsqueeze(torch.tensor(x), 1))