!48181 fix bug of function api multi_label_margin_loss

Merge pull request !48181 from ZhidanLiu/master
This commit is contained in:
i-robot 2023-01-30 11:41:49 +00:00 committed by Gitee
commit c2a5253dca
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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
mindspore/mindspore/ccsrc/plugin/device/cpu/hal/device/cpu_device_address.cc:mindspore::device::cpu::CPUDeviceAddress::SyncHostToDevice

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

@ -5113,8 +5113,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.
@ -5136,7 +5134,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