提交 578c145b authored 作者: Matthias Kümmerer's avatar Matthias Kümmerer

R_op for AbstractConv2d

上级 25e6df0f
...@@ -308,6 +308,17 @@ class AbstractConv2d(BaseAbstractConv2d): ...@@ -308,6 +308,17 @@ class AbstractConv2d(BaseAbstractConv2d):
'Did you exclude both "conv_dnn" and "conv_gemm" from ' 'Did you exclude both "conv_dnn" and "conv_gemm" from '
'the optimizer? Is cudnn available and does the GPU support it?') 'the optimizer? Is cudnn available and does the GPU support it?')
def R_op(self, inputs, eval_points):
rval = None
if eval_points[0] is not None:
rval = self.make_node(eval_points[0], inputs[1]).outputs[0]
if eval_points[1] is not None:
if rval is None:
rval = self.make_node(inputs[0], eval_points[1]).outputs[0]
else:
rval += self.make_node(inputs[0], eval_points[1]).outputs[0]
return [rval]
def grad(self, inp, grads): def grad(self, inp, grads):
bottom, weights = inp bottom, weights = inp
top, = grads top, = grads
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论