提交 39108661 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fix to the bug in the gradient of argmax

上级 0ab43b1b
......@@ -2300,6 +2300,9 @@ class MaxAndArgmax(Op):
x, axis = inp
g_max, g_max_idx = grads
# Check to see if the gradient on max is None
if g_max is None:
return None, None
xmax = max(x, axis)
# Raise the g_max and xmax to the same number of dim as the input.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论