提交 dd58fb00 authored 作者: p's avatar p

tests the fix for 'float64' in RNNs, wastes memory and breaks when warn_float64=raise

上级 f777fd27
from __future__ import absolute_import, print_function, division
__author__ = "deepworx"
__contact__ = "deepworx@GitHub"
import unittest
import theano, numpy
class RaiseOnFloat64(unittest.TestCase):
s = theano.tensor.lscalar()
a = theano.tensor.alloc(numpy.asarray(5, dtype='float32'), s, s)
orig = theano.config.warn_float64
theano.config.warn_float64 = "raise"
try:
f = theano.function([s], a.sum())
theano.printing.debugprint(f)
f(5)
finally:
theano.config.warn_float64 = orig
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论