From 3fc80850761d6155255613e30f392033d486dee8 Mon Sep 17 00:00:00 2001 From: yide12 Date: Sat, 24 Dec 2022 10:09:59 +0800 Subject: [PATCH] fix_docs --- docs/api/api_python/nn/mindspore.nn.CTCLoss.rst | 4 ++-- mindspore/python/mindspore/common/tensor.py | 4 ++-- mindspore/python/mindspore/nn/loss/loss.py | 4 ++-- mindspore/python/mindspore/ops/function/nn_func.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api/api_python/nn/mindspore.nn.CTCLoss.rst b/docs/api/api_python/nn/mindspore.nn.CTCLoss.rst index d8888a08ad9..2937b41fd80 100644 --- a/docs/api/api_python/nn/mindspore.nn.CTCLoss.rst +++ b/docs/api/api_python/nn/mindspore.nn.CTCLoss.rst @@ -29,5 +29,5 @@ mindspore.nn.CTCLoss - **ValueError** - `reduction` 不为"none","mean"或"sum"。 - **ValueError** - `targets` , `input_lengths` 或 `target_lengths` 的数据类型是不同的。 - **ValueError** - `blank` 值不介于0到C之间。C是 `log_probs` 的分类数。 - - **ValueError** - `input_lengths` 的值大于T。T是 `log_probs` 的长度。 - - **ValueError** - `target_lengths[i]` 的值不介于0到 `input_length[i]` 之间。 + - **RuntimeError** - `input_lengths` 的值大于T。T是 `log_probs` 的长度。 + - **RuntimeError** - `target_lengths[i]` 的值不介于0到 `input_length[i]` 之间。 diff --git a/mindspore/python/mindspore/common/tensor.py b/mindspore/python/mindspore/common/tensor.py index a43b7630b97..2abe8bcc5e7 100644 --- a/mindspore/python/mindspore/common/tensor.py +++ b/mindspore/python/mindspore/common/tensor.py @@ -2657,14 +2657,14 @@ class Tensor(Tensor_): def digamma(self): r""" - Refer to :func:`mindspore.ops.digamma`. + For details, please refer to :func:`mindspore.ops.digamma`. """ self._init_check() return tensor_operator_registry.get('digamma')(self) def lgamma(self): r""" - Refer to :func:`mindspore.ops.lgamma`. + For details, please refer to :func:`mindspore.ops.lgamma`. """ self._init_check() return tensor_operator_registry.get('lgamma')(self) diff --git a/mindspore/python/mindspore/nn/loss/loss.py b/mindspore/python/mindspore/nn/loss/loss.py index 3fba3adff91..06239a8c332 100644 --- a/mindspore/python/mindspore/nn/loss/loss.py +++ b/mindspore/python/mindspore/nn/loss/loss.py @@ -2430,8 +2430,8 @@ class CTCLoss(LossBase): ValueError: If `reduction` is not "none", "mean" or "sum". ValueError: If the types of `targets`, `input_lengths` or `target_lengths` are different. ValueError: If the value of `blank` is not in range [0, C). C is number of classes of `log_probs` . - ValueError: If any value of `input_lengths` is larger than T. T is length of `log_probs` . - ValueError: If any target_lengths[i] is not in range [0, input_length[i]]. + RuntimeError: If any value of `input_lengths` is larger than T. T is length of `log_probs` . + RuntimeError: If any target_lengths[i] is not in range [0, input_length[i]]. Supported Platforms: ``Ascend`` ``GPU`` ``CPU`` diff --git a/mindspore/python/mindspore/ops/function/nn_func.py b/mindspore/python/mindspore/ops/function/nn_func.py index 1b9631c6ef2..ed7e0477770 100644 --- a/mindspore/python/mindspore/ops/function/nn_func.py +++ b/mindspore/python/mindspore/ops/function/nn_func.py @@ -2967,8 +2967,8 @@ def l1_loss(x, target, reduction='mean'): \end{cases} Args: - x (Tensor) - Predicted value, Tensor of any dimension. - target (Tensor) - Target value, same shape as the `x` . + x (Tensor): Predicted value, Tensor of any dimension. + target (Tensor): Target value, same shape as the `x` . reduction (str, optional): Type of reduction to be applied to loss. The optional value is "mean", "sum" or "none". Default: "mean".