提交 d7e13316 authored 作者: Frederic Bastien's avatar Frederic Bastien

added test for the autocast of tensor with numpy.float{,32,64}

上级 faa42f89
......@@ -2498,6 +2498,12 @@ def test_autocast():
assert (dvector()+ 1.1).dtype == 'float64'
assert (fvector()+ 1.1).dtype == theano.config.floatX
assert (fvector()+ 1.0).dtype == 'float32'
assert (dvector()+ numpy.float32(1.1)).dtype == 'float64'
assert (dvector()+ numpy.float64(1.1)).dtype == 'float64'
assert (dvector()+ numpy.float(1.1)).dtype == 'float64'
assert (fvector()+ numpy.float32(1.1)).dtype == 'float32'
assert (fvector()+ numpy.float64(1.1)).dtype == 'float64'
assert (fvector()+ numpy.float(1.1)).dtype == theano.config.floatX
try: #ghetto 2.4 version of with
ac2 = autocast_float_as('float64')
ac2.__enter__()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论