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

Better optimization name

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