Imagenet 10-crop testing example

I am trying to use 10-crop testing feature of Pytorch. However, i want to store the dataloader to a pickle file for efficiency. Ten crop testing requires a lambda function and i get a traceback as follows

AttributeError: Can't pickle local object 'main.<locals>.<lambda>'

So is there any other way apart from the one mentioned in original docs

FYI original tencrop transform is

transform = Compose([
Lambda(lambda crops: torch.stack([ToTensor()(crop) for crop in crops]))

The imagenet example is
though this issue is independent of the dataset.

We dont support serialization of DataLoaders. What efficiency are you going for?

Generating the loaders takes a long time atleast for Imagenet. Instead of generating it everytime, i ran it once and stored it as a pickle file. Though i am not sure if this is the optimal way, please let me know if there is any other way.