def _test_btrifact(self, cast):
a = torch.FloatTensor((((1.3722, -0.9020),
(1.8849, 1.9169)),
((0.7187, -1.1695),
(-0.0139, 1.3572)),
((-1.6181, 0.7148),
(1.3728, 0.1319))))
a = cast(a)
info = cast(torch.IntTensor())
a_LU = a.btrifact(info=info)
self.assertEqual(info.abs().sum(), 0)
P, a_L, a_U = torch.btriunpack(*a_LU)
a_ = torch.bmm(P, torch.bmm(a_L, a_U))
self.assertEqual(a_, a)
评论列表
文章目录