forked from mindspore-Ecosystem/mindspore
fix bug of api function multi_label_margin_loss
This commit is contained in:
parent
f9dcdba238
commit
7d6e62bae4
|
@ -262,4 +262,5 @@ 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
|
||||
|
|
|
@ -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时。
|
||||
|
|
|
@ -4462,7 +4462,7 @@ def glu(x, axis=-1):
|
|||
>>> input = Tensor([[0.1,0.2,0.3,0.4],[0.5,0.6,0.7,0.8]])
|
||||
>>> output = ops.glu(input)
|
||||
>>> print(output)
|
||||
[[0.05744425 0.11973753
|
||||
[[0.05744425 0.11973753]
|
||||
[0.33409387 0.41398472]]
|
||||
"""
|
||||
if not isinstance(x, Tensor) or x.size == 0:
|
||||
|
@ -4580,8 +4580,7 @@ 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.
|
||||
|
@ -4603,7 +4602,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
|
||||
|
||||
|
|
Loading…
Reference in New Issue