I’m not sure, but I think transforms.LinearTransformation 108 would be a good approach. You would need to create the transformation matrix offline and apply it on the tensor. I’m currently not on my computer, otherwise I would create a small example. Let me know if that’s desirable and I could write it a bit later.