Solved by sidwa0 in post #6 
              
              
                @pfloat’s solution with torch.repeat_interleave is quite interesting. However, I found something simple. 
Upper triangular matrix 
t = 8
tri = torch.triu( torch.ones(8,8), diagonal=1 )
tri
tensor([[0., 1., 1., 1., 1., 1., 1., 1.],
        [0., 0., 1., 1., 1., 1., 1., 1.],
        [0., 0., 0., 1., 1.…