Note @gelarazi Please consider adding the appropriate imports to your code   (I tried running it, to see what happens, and then had to ponder figuring out what all the relevant imports are … ).  Edit: oh, also, `#lower triangular 5x5 tensor# is a variable, not some inline commenting style I didnt know about before. I think it would be easier to reproduce if you created some random tensor (including seed), to demonstrate the issue with.