提交 f4b05e45 authored 作者: Faruk Ahmed's avatar Faruk Ahmed

applying Fredits

上级 17666684
......@@ -3413,7 +3413,7 @@ def local_incsubtensor_of_zeros(node):
@register_canonicalize
@register_specialize
@gof.local_optimizer([IncSubtensor])
def incsubtensor_of_zeros_to_setsubtensor(node):
def local_incsubtensor_of_zeros_to_setsubtensor(node):
"""
IncSubtensor(zeros, x, ...) -> SetSubtensor(zeros, x, ...)
"""
......
......@@ -573,8 +573,9 @@ class Subtensor(Op):
else:
# For best optimization, we let this as an inc.
# This allow the opt local_IncSubtensor_serialize to apply first.
# We need to implement an optimization that will convert this to a
# set subtensor.
# We have an optimization that will convert this to a
# set subtensor here at:
# theano/tensor/opt.py:local_incsubtensor_of_zeros_to_setsubtensor()
first = IncSubtensor(self.idx_list)(x.zeros_like(),
gz, *rest)
return ([first] + [DisconnectedType()()] * len(rest))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论