def create_lazy_tensor(self): mat1 = make_random_mat(40, rank=5, batch_size=2) mat2 = make_random_mat(40, rank=5, batch_size=2) mat3 = make_random_mat(40, rank=5, batch_size=2) mat4 = make_random_mat(40, rank=5, batch_size=2) mat5 = make_random_mat(40, rank=5, batch_size=2) res = MulLazyTensor(RootLazyTensor(mat1), RootLazyTensor(mat2), RootLazyTensor(mat3), RootLazyTensor(mat4), RootLazyTensor(mat5)) return res.add_diag(torch.tensor(0.5))
def create_lazy_tensor(self): mat1 = make_random_mat(30, 3) mat2 = make_random_mat(30, 3) mat3 = make_random_mat(30, 3) mat4 = make_random_mat(30, 3) mat5 = make_random_mat(30, 3) res = MulLazyTensor(RootLazyTensor(mat1), RootLazyTensor(mat2), RootLazyTensor(mat3), RootLazyTensor(mat4), RootLazyTensor(mat5)) return res.add_diag(torch.tensor(1.0))
def create_lazy_tensor(self): mat1 = make_random_mat(6, rank=5, batch_size=2) mat2 = make_random_mat(6, rank=5, batch_size=2) res = MulLazyTensor(RootLazyTensor(mat1), RootLazyTensor(mat2)) return res.add_diag(torch.tensor(2.0))
def create_lazy_tensor(self): mat1 = make_random_mat(6, 3) mat2 = make_random_mat(6, 3) res = MulLazyTensor(RootLazyTensor(mat1), RootLazyTensor(mat2)) return res.add_diag(torch.tensor(2.))