Browse Source

!12285 fix bugs of op BCELoss in API

From: @lihongkang1
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
461e020bb9
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      mindspore/nn/loss/loss.py

+ 5
- 5
mindspore/nn/loss/loss.py View File

@@ -606,9 +606,9 @@ class BCELoss(_Loss):

.. math::
\ell(x, y) = \begin{cases}
L, & \text{if reduction} = \text{`none';}\\
\operatorname{mean}(L), & \text{if reduction} = \text{`mean';}\\
\operatorname{sum}(L), & \text{if reduction} = \text{`sum'.}
L, & \text{if reduction} = \text{'none';}\\
\operatorname{mean}(L), & \text{if reduction} = \text{'mean';}\\
\operatorname{sum}(L), & \text{if reduction} = \text{'sum'.}
\end{cases}

Note:
@@ -630,9 +630,9 @@ class BCELoss(_Loss):
Otherwise, the output is a scalar.

Raises:
TypeError: If dtype of `inputs`, `labels` or `weight`(if given) is neither float16 not float32.
TypeError: If dtype of `inputs`, `labels` or `weight` (if given) is neither float16 not float32.
ValueError: If `reduction` is not one of 'none', 'mean', 'sum'.
ValueError: If shape of `inputs` is not the same as `labels` or `weight`(if given).
ValueError: If shape of `inputs` is not the same as `labels` or `weight` (if given).

Supported Platforms:
``Ascend`` ``GPU``


Loading…
Cancel
Save