MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _solve

Method _solve

tensorflow/python/ops/linalg/linear_operator.py:726–739  ·  view source on GitHub ↗

Default implementation of _solve.

(self, rhs, adjoint=False, adjoint_arg=False)

Source from the content-addressed store, hash-verified

724 return self._log_abs_determinant()
725
726 def _solve(self, rhs, adjoint=False, adjoint_arg=False):
727 """Default implementation of _solve."""
728 if self.is_square is False:
729 raise NotImplementedError(
730 "Solve is not yet implemented for non-square operators.")
731 logging.warn(
732 "Using (possibly slow) default implementation of solve."
733 " Requires conversion to a dense matrix and O(N^3) operations.")
734 rhs = linalg.adjoint(rhs) if adjoint_arg else rhs
735 if self._can_use_cholesky():
736 return linear_operator_util.cholesky_solve_with_broadcast(
737 linalg_ops.cholesky(self.to_dense()), rhs)
738 return linear_operator_util.matrix_solve_with_broadcast(
739 self.to_dense(), rhs, adjoint=adjoint)
740
741 def solve(self, rhs, adjoint=False, adjoint_arg=False, name="solve"):
742 """Solve (exact or approx) `R` (batch) systems of equations: `A X = rhs`.

Callers 1

solveMethod · 0.95

Calls 4

_can_use_choleskyMethod · 0.95
to_denseMethod · 0.95
adjointMethod · 0.80
choleskyMethod · 0.80

Tested by

no test coverage detected