提交 74863ee8 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fixed the gradient of set_subtensor

Before only the gradient of inc_subtensor was ok ( and it also was the only one checked)
上级 106b8308
......@@ -3708,7 +3708,12 @@ class IncSubtensor(Op):
x, y = inputs[:2]
idx_list = inputs[2:]
gx = g_output
if self.set_instead_of_inc:
gx = set_subtensor(
Subtensor(idx_list=self.idx_list)(g_output,*idx_list),
zeros_like(y))
else:
gx = g_output
gy = Subtensor(idx_list = self.idx_list)(g_output, *idx_list)
return [gx, gy] + [None]*len(idx_list)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论