提交 b17d56b9 authored 作者: Ziye Fan's avatar Ziye Fan

solve the failed test case local_mul_switch_local, by register local_elemwise_alloc to canonicalize

上级 4b353074
...@@ -2031,6 +2031,11 @@ local_elemwise_alloc = register_specialize( ...@@ -2031,6 +2031,11 @@ local_elemwise_alloc = register_specialize(
local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)), local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)),
'local_alloc_elemwise') 'local_alloc_elemwise')
local_elemwise_alloc = register_canonicalize(
gof.local_optimizer([T.Elemwise])(
local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)),
'local_alloc_elemwise')
theano.configparser.AddConfigVar('experimental.local_alloc_elemwise', theano.configparser.AddConfigVar('experimental.local_alloc_elemwise',
"DEPRECATED: If True, enable the experimental" "DEPRECATED: If True, enable the experimental"
" optimization local_alloc_elemwise." " optimization local_alloc_elemwise."
......
...@@ -4078,6 +4078,7 @@ class T_local_switch_sink(unittest.TestCase): ...@@ -4078,6 +4078,7 @@ class T_local_switch_sink(unittest.TestCase):
self.mode = theano.compile.mode.get_default_mode().including( self.mode = theano.compile.mode.get_default_mode().including(
'canonicalize', 'fast_run').excluding('gpu', 'fusion') 'canonicalize', 'fast_run').excluding('gpu', 'fusion')
theano.config.experimental.local_alloc_elemwise_assert = False
self.mode = copy.copy(self.mode) self.mode = copy.copy(self.mode)
self.mode.check_isfinite = False self.mode.check_isfinite = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论