Exemple #1
0
def test_matrix_inverse_solve():
    if not imported_scipy:
        pytest.skip("Scipy needed for the Solve op.")
    A = theano.tensor.dmatrix("A")
    b = theano.tensor.dmatrix("b")
    node = matrix_inverse(A).dot(b).owner
    [out] = inv_as_solve.transform(node)
    assert isinstance(out.owner.op, Solve)
Exemple #2
0
def test_matrix_inverse_solve():
    if not imported_scipy:
        raise SkipTest("Scipy needed for the Solve op.")
    A = theano.tensor.dmatrix('A')
    b = theano.tensor.dmatrix('b')
    node = matrix_inverse(A).dot(b).owner
    [out] = inv_as_solve.transform(node)
    assert isinstance(out.owner.op, Solve)               
Exemple #3
0
def test_matrix_inverse_as_solve_right():
    if not imported_scipy:
        raise SkipTest("Scipy needed for the Solve op.")
    A = theano.tensor.dmatrix('A')
    B = theano.tensor.dmatrix('B')
    node = B.dot(matrix_inverse(A)).owner
    [out] = inv_as_solve.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, Solve)
Exemple #4
0
def test_matrix_inverse_solve():
    A = theano.tensor.dmatrix('A')
    b = theano.tensor.dmatrix('b')
    node = matrix_inverse(A).dot(b).owner
    [out] = inv_as_solve.transform(node)
    assert isinstance(out.owner.op, Solve)
Exemple #5
0
def test_matrix_inverse_solve():
    A = theano.tensor.dmatrix('A')
    b = theano.tensor.dmatrix('b')
    node = matrix_inverse(A).dot(b).owner
    [out] = inv_as_solve.transform(node)
    assert isinstance(out.owner.op, Solve)