From 3ca813e643ec7c0eb50bc8d0804ce591e4f0a95f Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Sun, 15 Aug 2021 21:39:48 +0800 Subject: [PATCH] Update loss.py --- python/paddle/nn/functional/loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index b2b305fdf8..21b1e444ef 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -1801,7 +1801,7 @@ def cross_entropy(input, weight_gather_reshape = reshape(weight_gather, shape=out_shape) out = paddle.cast(out, weight_gather_reshape.dtype) else: - if input.shape[-1] != weight.shape[-1]: + if input.shape[-1] != weight.shape[-1]: raise ValueError("input's class_dimension({}) must equal to "\ "weight's class_dimension({}) "\ "when weight is provided" -- GitLab