提交 1db19553 authored 作者: Florian Bordes's avatar Florian Bordes

Warn if taking softmax over broadcastable dimension

上级 76cfd7e8
...@@ -802,6 +802,9 @@ def softmax_graph(c): ...@@ -802,6 +802,9 @@ def softmax_graph(c):
def softmax(c): def softmax(c):
c = as_tensor_variable(c)
if c.broadcastable[-1]:
warnings.warn("The softmax is appllied on a dimension of shape 1, which doesn't have a semantic meaning.")
return softmax_op(c) return softmax_op(c)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论