Example #1
0
def test_complexfunctions():
    xt, yt = theano_code(x, dtypes={x:'complex128'}), theano_code(y, dtypes={y: 'complex128'})
    from sympy import conjugate
    from theano.tensor import as_tensor_variable as atv
    from theano.tensor import complex as cplx
    assert theq(theano_code(y*conjugate(x)), yt*(xt.conj()))
    assert theq(theano_code((1+2j)*x), xt*(atv(1.0)+atv(2.0)*cplx(0,1)))
Example #2
0
def test_complexfunctions():
    with warns_deprecated_sympy():
        xt, yt = theano_code_(x, dtypes={x:'complex128'}), theano_code_(y, dtypes={y: 'complex128'})
    from sympy import conjugate
    from theano.tensor import as_tensor_variable as atv
    from theano.tensor import complex as cplx
    with warns_deprecated_sympy():
        assert theq(theano_code_(y*conjugate(x)), yt*(xt.conj()))
        assert theq(theano_code_((1+2j)*x), xt*(atv(1.0)+atv(2.0)*cplx(0,1)))
Example #3
0
def test_complexfunctions():
    xt, yt = (
        theano_code(x, dtypes={x: "complex128"}),
        theano_code(y, dtypes={y: "complex128"}),
    )
    from sympy import conjugate
    from theano.tensor import as_tensor_variable as atv
    from theano.tensor import complex as cplx

    assert theq(theano_code(y * conjugate(x)), yt * (xt.conj()))
    assert theq(theano_code((1 + 2j) * x),
                xt * (atv(1.0) + atv(2.0) * cplx(0, 1)))