I’m performing a slightly complicated form of compression on the MNIST dataset, that involves sequentially taking QR decompositions of the input vector (i.e., start with an input vector of length L, split it into a vector with shape (2, L/2), take a QR decomposition of that, then repeat on the R matrix). Because it is sequential, it is hard to parallelize, and generally takes some nontrivial time to perform (about 1 second on my machine). This would be fine, but Pytorch does not appear to be doing any kind of caching when I do this – successive epochs are just as slow as the first one. I’m fairly new to Pytorch, so I wanted to ask if this is the expected behavior? If so, should I perform the transformation first, then save my own local copy of the transformed dataset, and make a new dataloader from that?