How to create upper triangular matrix in Pytorch?
Simple question, but is there a native way to create an upper triangular matrix from an existing matrix in Pytorch? I was thinking of using a mask, but even that requires creating the upper triangular matrix. 

import torch
upper_tri = torch.ones(rol, col).triu()

Eg:
&gt;&gt; mat = torch.ones(3, 3).triu()
&gt;&gt; print(mat)
tensor([[1., 1., 1.],
        [0., 1., 1.],
        [0., 0., 1.]])

