torchvision.transforms flatten code example
Example: torchvision.transforms flatten
import torchvision.transforms as T
transform=T.Compose([T.ToTensor(), T.Lambda(lambda x: torch.flatten(x))])
import torchvision.transforms as T
transform=T.Compose([T.ToTensor(), T.Lambda(lambda x: torch.flatten(x))])