Returns x such that A * x = b.

Implements the Conjugate Gradient method.

a_mat a Symmetric Positive Definite matrix, represented as a Tensor of shape [n, n].
b a Tensor of shape [n, 1].
tol (float) desired tolerance on the residual.

x Tensor x of shape [n, 1] such that A * x = b.

ValueError if a_mat is not square or a_mat and b have incompatible shapes.