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

Better optimization name

上级 527d6e61
...@@ -2334,10 +2334,11 @@ compile.optdb.register('local_inplace_incsubtensor1', ...@@ -2334,10 +2334,11 @@ compile.optdb.register('local_inplace_incsubtensor1',
60, 'fast_run', 'inplace') # DEBUG 60, 'fast_run', 'inplace') # DEBUG
@register_canonicalize # Register old name
@register_stabilize @register_canonicalize("local_incsubtensor_of_allocs")
@register_stabilize("local_incsubtensor_of_allocs")
@gof.local_optimizer([IncSubtensor]) @gof.local_optimizer([IncSubtensor])
def local_incsubtensor_of_allocs(node): def local_incsubtensor_of_zeros(node):
""" """
IncSubtensor(x, zeros, idx) -> x IncSubtensor(x, zeros, idx) -> x
""" """
...@@ -2357,10 +2358,10 @@ def local_incsubtensor_of_allocs(node): ...@@ -2357,10 +2358,10 @@ def local_incsubtensor_of_allocs(node):
return False return False
@register_canonicalize @register_canonicalize('local_setsubtensor_of_allocs')
@register_stabilize @register_stabilize('local_setsubtensor_of_allocs')
@gof.local_optimizer([IncSubtensor]) @gof.local_optimizer([IncSubtensor])
def local_setsubtensor_of_allocs(node): def local_setsubtensor_of_constants(node):
""" """
SetSubtensor(x, x[idx], idx) -> x SetSubtensor(x, x[idx], idx) -> x
......
...@@ -2372,8 +2372,8 @@ class test_local_subtensor_merge(unittest.TestCase): ...@@ -2372,8 +2372,8 @@ class test_local_subtensor_merge(unittest.TestCase):
class Test_alloc_zero(unittest.TestCase): class Test_alloc_zero(unittest.TestCase):
def setUp(self): def setUp(self):
mode = theano.compile.mode.get_default_mode() mode = theano.compile.mode.get_default_mode()
self.mode = mode.including("local_incsubtensor_of_allocs", self.mode = mode.including("local_incsubtensor_of_zeros",
"local_setsubtensor_of_allocs", "local_setsubtensor_of_constants",
"local_0_dot_x") "local_0_dot_x")
def test_setsubtensor_allocs0(self): def test_setsubtensor_allocs0(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论