@spaceinvader You are right, the numpy solution will be slow and non-differentiable.
@colesbury How about reversing the stride manually to perform less operations like this:
t = torch.randn(3, 5)
t.set_(t.storage(), t.storage_offset(), t.size(), tuple(reversed(t.stride())))

This should have the same effect as t = t.t().contiguous().t() but is potentially faster.