def test_triu(self): x = torch.rand(SIZE, SIZE) res1 = torch.triu(x) res2 = torch.Tensor() torch.triu(res2, x) self.assertEqual(res1, res2, 0)