def inv_matmul(self, right_tensor, left_tensor=None):
with settings.fast_computations(solves=False):
return super().inv_matmul(right_tensor, left_tensor=left_tensor)
def inv_quad_logdet(self, inv_quad_rhs=None, logdet=False, reduce_inv_quad=True):
if not self.is_square:
raise RuntimeError(
After Change
def inv_matmul(self, right_tensor, left_tensor=None):
is_vector = right_tensor.ndim == 1
if is_vector:
right_tensor = right_tensor.unsqueeze(-1)res = self.root._cholesky_solve(right_tensor, upper=self.upper)
if left_tensor is not None:
res = left_tensor @ res
if is_vector:
res = res.squeeze(-1)
return res
def inv_quad(self, tensor, reduce_inv_quad=True):
if self.root.upper:
R = self.root._transpose_nonbatch().inv_matmul(tensor)