提交 7966b05c authored 作者: Ian Goodfellow's avatar Ian Goodfellow

corrected grad for dot

上级 049edc8d
...@@ -6504,7 +6504,11 @@ class Dot(Op): ...@@ -6504,7 +6504,11 @@ class Dot(Op):
rval = outer(gz, y.T), dot(x.T, gz) rval = outer(gz, y.T), dot(x.T, gz)
else: else:
rval = dot(gz, y.T), dot(x.T, gz) rval = dot(gz, y.T), dot(x.T, gz)
return cast(rval[0], x.dtype), cast(rval[1], y.dtype)
for elem in rval:
assert elem.dtype.find('float') != -1
return rval
def R_op(self, inputs, eval_points): def R_op(self, inputs, eval_points):
# R_op for a \dot b evaluted at c for a and d for b is # R_op for a \dot b evaluted at c for a and d for b is
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论