TORCH.TRIU
torch.triu(input, diagonal=0, *, out=None) → Tensor返回一个上三角矩阵参数:input:输入的张量diagonal:对角线>>> a = torch.randn(3, 3)>>> atensor([[ 0.2309, 0.5207, 2.0049], [ 0.2072, -1.0680, 0.6602], [ 0.3480, -0