What about .contiguous instead of .clone ? Wouldn’t those 2 operations achieve the same goal before inplace modifications?
I might be going a bit off-topic, I am new to PyTorch and am trying to get what are best practices.