提交 063c1966 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

R operator for subtensor

上级 7733f88b
...@@ -3358,6 +3358,13 @@ class Subtensor(Op): ...@@ -3358,6 +3358,13 @@ class Subtensor(Op):
hv = self.helper_c_code_cache_version() hv = self.helper_c_code_cache_version()
return (1, hv) return (1, hv)
def R_op(self, inputs, eval_points):
# Subtensor is not differentiable wrt to its indices, therefore we
# do not even need to consider the eval_points provided for those
# (they should be defaulted to zeros_like by the global R_op)
if eval_points[0] is None:
return [None]
return self.make_node(eval_points[0], *inputs[1:]).outputs
class SubtensorPrinter: class SubtensorPrinter:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论