提交 e839d144 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

grad for bincount

上级 9f85fb28
......@@ -148,7 +148,13 @@ class BinCountOp(theano.Op):
z[0] = np.bincount(x, weights=weights, minlength=self.minlength)
def grad(self, inputs, outputs_gradients):
return [None for i in inputs]
output = self(*inputs)
if output.dtype.find('int') != -1:
return [ inp.zeros_like().astype(theano.config.floatX)
for inp in inputs ]
raise NotImplementedError()
def infer_shape(self, node, ins_shapes):
x = node.inputs[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论