提交 d38aff3e authored 作者: James Bergstra's avatar James Bergstra

updated complex test to match new implementations of real and imag

上级 1a797fb4
...@@ -16,16 +16,14 @@ class TestRealImag(unittest.TestCase): ...@@ -16,16 +16,14 @@ class TestRealImag(unittest.TestCase):
x= dvector() x= dvector()
rng = numpy.random.RandomState(23) rng = numpy.random.RandomState(23)
xval = rng.randn(10) xval = rng.randn(10)
try:
numpy.all( 0 == theano.function([x], imag(x))(xval)) numpy.all( 0 == theano.function([x], imag(x))(xval))
assert 0
except TypeError:
pass
try:
numpy.all( xval == theano.function([x], real(x))(xval)) numpy.all( xval == theano.function([x], real(x))(xval))
assert 0
except TypeError:
pass x= imatrix()
xval = numpy.asarray(rng.randn(3,3)*100, dtype='int')
numpy.all( 0 == theano.function([x], imag(x))(xval))
numpy.all( xval == theano.function([x], real(x))(xval))
def test_cast(self): def test_cast(self):
x= zvector() x= zvector()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论