def test_matrix_inverse_cholesky_as_solve_cholesky_left(): if not imported_scipy: raise SkipTest("Scipy needed for the SolveCholesky op.") A = theano.tensor.dmatrix('A') B = theano.tensor.dmatrix('B') node = matrix_inverse_cholesky(A).dot(B).owner [out] = inv_cholesky_as_solve_cholesky.transform(node) assert isinstance(out.owner.op, SolveCholesky)
def test_matrix_inverse_cholesky_as_solve_cholesky_right(): if not imported_scipy: raise SkipTest("Scipy needed for the SolveCholesky op.") A = theano.tensor.dmatrix('A') B = theano.tensor.dmatrix('B') node = B.dot(matrix_inverse_cholesky(A)).owner [out] = inv_cholesky_as_solve_cholesky.transform(node) # take into account the transpose after the solve operation, so go up one # in expression tree assert isinstance(out.owner.inputs[0].owner.op, SolveCholesky)