def test_tag_solve_triangular(): cholesky_lower = Cholesky(lower=True) cholesky_upper = Cholesky(lower=False) A = tensor.matrix('A') x = tensor.vector('x') L = cholesky_lower(A) U = cholesky_upper(A) b1 = solve(L, x) b2 = solve(U, x) f = theano.function([A,x], b1) for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == 'lower_triangular' f = theano.function([A,x], b2) for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == 'upper_triangular'
def test_tag_solve_triangular(): if not imported_scipy: pytest.skip("Scipy needed for the Cholesky op.") cholesky_lower = Cholesky(lower=True) cholesky_upper = Cholesky(lower=False) A = tensor.matrix("A") x = tensor.vector("x") L = cholesky_lower(A) U = cholesky_upper(A) b1 = solve(L, x) b2 = solve(U, x) f = theano.function([A, x], b1) if config.mode != "FAST_COMPILE": for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == "lower_triangular" f = theano.function([A, x], b2) if config.mode != "FAST_COMPILE": for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == "upper_triangular"
def test_tag_solve_triangular(): if not imported_scipy: raise SkipTest("Scipy needed for the Cholesky op.") cholesky_lower = Cholesky(lower=True) cholesky_upper = Cholesky(lower=False) A = tensor.matrix('A') x = tensor.vector('x') L = cholesky_lower(A) U = cholesky_upper(A) b1 = solve(L, x) b2 = solve(U, x) f = theano.function([A, x], b1) if config.mode != 'FAST_COMPILE': for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == 'lower_triangular' f = theano.function([A, x], b2) if config.mode != 'FAST_COMPILE': for node in f.maker.fgraph.toposort(): if isinstance(node.op, Solve): assert node.op.A_structure == 'upper_triangular'