Aliases:
tf.cholesky_solvetf.linalg.cholesky_solve
tf.linalg.cholesky_solve(
chol,
rhs,
name=None
)
Defined in tensorflow/python/ops/linalg_ops.py.
Solves systems of linear eqns A X = RHS, given Cholesky factorizations.
# Solve 10 separate 2x2 linear systems:
A = ... # shape 10 x 2 x 2
RHS = ... # shape 10 x 2 x 1
chol = tf.cholesky(A) # shape 10 x 2 x 2
X = tf.cholesky_solve(chol, RHS) # shape 10 x 2 x 1
# tf.matmul(A, X) ~ RHS
X[3, :, 0] # Solution to the linear system A[3, :, :] x = RHS[3, :, 0]
# Solve five linear systems (K = 5) for every member of the length 10 batch.
A = ... # shape 10 x 2 x 2
RHS = ... # shape 10 x 2 x 5
...
X[3, :, 2] # Solution to the linear system A[3, :, :] x = RHS[3, :, 2]
Args:
chol: ATensor. Must befloat32orfloat64, shape is[..., M, M]. Cholesky factorization ofA, e.g.chol = tf.cholesky(A). For that reason, only the lower triangular parts (including the diagonal) of the last two dimensions ofcholare used. The strictly upper part is assumed to be zero and not accessed.rhs: ATensor, same type aschol, shape is[..., M, K].name: A name to give thisOp. Defaults tocholesky_solve.
Returns:
Solution to A x = rhs, shape [..., M, K].