예제 #1
0
파일: test_op.py 프로젝트: Abioy/Theano
def test_test_value_op():
    try:
        prev_value = config.compute_test_value
        config.compute_test_value = 'raise'
        x = T.log(numpy.ones((5, 5)))
        v = op.get_test_value(x)

        assert numpy.allclose(v, numpy.zeros((5, 5)))
    finally:
        config.compute_test_value = prev_value
예제 #2
0
파일: test_op.py 프로젝트: Abioy/Theano
def test_test_value_shared():
    x = shared(numpy.zeros((5, 5)))
    v = op.get_test_value(x)

    assert numpy.all(v == numpy.zeros((5, 5)))
예제 #3
0
파일: test_op.py 프로젝트: Abioy/Theano
def test_test_value_ndarray():
    x = numpy.zeros((5, 5))
    v = op.get_test_value(x)
    assert (v == x).all()
예제 #4
0
파일: test_op.py 프로젝트: Abioy/Theano
def test_test_value_constant():
    x = T.as_tensor_variable(numpy.zeros((5, 5)))
    v = op.get_test_value(x)

    assert numpy.all(v == numpy.zeros((5, 5)))
예제 #5
0
def test_test_value_python_objects():
    for x in (range(3), 0, 0.5, 1):
        assert (op.get_test_value(x) == x).all()
예제 #6
0
파일: test_op.py 프로젝트: Abioy/Theano
def test_test_value_python_objects():
    for x in ([0, 1, 2], 0, 0.5, 1):
        assert (op.get_test_value(x) == x).all()
예제 #7
0
def test_test_value_constant():
    x = T.as_tensor_variable(numpy.zeros((5, 5)))
    v = op.get_test_value(x)

    assert numpy.all(v == numpy.zeros((5, 5)))
예제 #8
0
def test_test_value_ndarray():
    x = numpy.zeros((5, 5))
    v = op.get_test_value(x)
    assert (v == x).all()
예제 #9
0
def test_test_value_python_objects():
    for x in (range(3), 0, 0.5, 1):
        assert (op.get_test_value(x) == x).all()
예제 #10
0
def test_test_value_shared():
    x = shared(numpy.zeros((5, 5)))
    v = op.get_test_value(x)

    assert numpy.all(v == numpy.zeros((5, 5)))
예제 #11
0
def test_test_value_python_objects():
    for x in ([0, 1, 2], 0, 0.5, 1):
        assert (op.get_test_value(x) == x).all()