Commit 8995e13a authored by Julian Treiber's avatar Julian Treiber

possible bug in SoftmaxCELossIgnoreIndices loss

parent 6e6da4e2
......@@ -51,7 +51,7 @@ class SoftmaxCrossEntropyLossIgnoreIndices(gluon.loss.Loss):
if self._sparse_label:
loss = -pick(pred, label, axis=self._axis, keepdims=True)
else:
label = _reshape_like(F, label, pred)
label = gluon.loss._reshape_like(F, label, pred)
loss = -(pred * label).sum(axis=self._axis, keepdims=True)
# ignore some indices for loss, e.g. <pad> tokens in NLP applications
for i in self._ignore_indices:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment