fix bug of function api multi_label_margin_loss

This commit is contained in:
ZhidanLiu 2023-01-30 11:04:09 +08:00
parent d9f164a3ad
commit 8b80b2fb6a
3 changed files with 2 additions and 4 deletions

View File

@ -266,6 +266,7 @@ mindspore/mindspore/ccsrc/pybind_api/ir/tensor_py.cc:mindspore::tensor::RegMetaT
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/eltwise_grad_cpu_kernel.cc:mindspore::kernel::EltWiseGradCpuTypeFunc<T>::InitFunc
mindspore/mindspore/lite/tools/converter/quantizer/weight_quantizer.cc:mindspore::lite::quant::WeightQuantizer::LinearQuant
mindspore/mindspore/python/mindspore/ops/function/nn_func.py:conv3d
mindspore/mindspore/python/mindspore/ops/function/nn_func.py:max_unpool3d
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/matmul_avx512_mask_fp32.c:GemmRowxColMaskKernelFp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/crop_and_resize_cpu_kernel.cc:mindspore::kernel::CropAndResizeCpuKernelMod::LaunchKernel

View File

@ -32,7 +32,6 @@ mindspore.ops.multi_label_margin_loss
返回:
- **outputs** (Union[Tensor, Scalar]) - MultilabelMarginLoss损失。如果 `reduction` 的值为 "none"
那么返回shape为 :math:`(N)` 的Tensor类型数据。否则返回一个标量。
- **is_target** (Tensor) - 基于反向输入数据返回Tensor类型的数据shape和 `target` 相同类型为int32。
异常:
- **TypeError** - 当 `inputs` 或者 `target` 数据不是Tensor时。

View File

@ -5115,8 +5115,6 @@ def multi_label_margin_loss(inputs, target, reduction='mean'):
Returns:
- **outputs** (Union[Tensor, Scalar]) - The loss of MultilabelMarginLoss. If `reduction` is "none", its shape
is :math:`(N)`. Otherwise, a scalar value will be returned.
- **is_target** (Tensor) - Output tensor for backward input, with the same shape as `target`,
data type must be int32.
Raises:
TypeError: If `inputs` or `target` is not a Tensor.
@ -5138,7 +5136,7 @@ def multi_label_margin_loss(inputs, target, reduction='mean'):
[[1, 1, 1, 1], [0, 0, 1, 1]]))
"""
loss = _get_cache_prim(P.MultiLabelMarginLoss)(reduction)
loss = _get_cache_prim(P.MultilabelMarginLoss)(reduction)
outputs, _ = loss(inputs, target)
return outputs