From 12ef0dcea9bd5fcb9346b6e5c2d0ef9d42cd5e5d Mon Sep 17 00:00:00 2001 From: huanxiaoling <3174348550@qq.com> Date: Tue, 13 Dec 2022 14:00:11 +0800 Subject: [PATCH] modify the format of files 1213 --- .../mindspore.dataset.audio.MFCC.rst | 2 +- .../mindspore/mindspore.JitConfig.rst | 2 +- .../ops/mindspore.ops.func_addr.rst | 3 ++- .../api_python/ops/mindspore.ops.func_t.rst | 2 +- .../ops/mindspore.ops.func_zeros.rst | 2 +- .../mindspore/ops/function/math_func.py | 2 +- .../mindspore/ops/operations/array_ops.py | 22 ++----------------- 7 files changed, 9 insertions(+), 26 deletions(-) diff --git a/docs/api/api_python/dataset_audio/mindspore.dataset.audio.MFCC.rst b/docs/api/api_python/dataset_audio/mindspore.dataset.audio.MFCC.rst index af92e82ac80..66817c1afe8 100644 --- a/docs/api/api_python/dataset_audio/mindspore.dataset.audio.MFCC.rst +++ b/docs/api/api_python/dataset_audio/mindspore.dataset.audio.MFCC.rst @@ -12,7 +12,7 @@ mindspore.dataset.audio.MFCC - **norm** (NormMode, 可选) - 要使用的标准类型。默认:NormMode.ORTHO。 - **log_mels** (bool, 可选) - 是否使用梅尔对数谱图而不是分贝刻度。默认:False。 - **melkwargs** (dict, 可选) - 梅尔频谱的参数,如果为None则使用默认参数。默认:None,会被设置为 - `{'n_fft': 400, 'win_length': n_fft, 'hop_length': win_length // 2, 'f_min' : 0.0, 'f_max' : sample_rate // 2, 'pad': 0, 'window': WindowType.HANN, 'power': 2.0, 'normalized': False, 'center': True, 'pad_mode': BorderType.REFLECT, 'onesided': True, 'norm' : NormType.NONE, 'mel_scale' : MelType.HTK}` 。 + `{'n_fft': 400, 'win_length': n_fft, 'hop_length': win_length // 2, 'f_min' : 0.0, 'f_max' : sample_rate // 2, 'pad': 0, 'window': WindowType.HANN, 'power': 2.0, 'normalized': False, 'center': True, 'pad_mode': BorderType.REFLECT, 'onesided': True, 'norm' : NormType.NONE, 'mel_scale' : MelType.HTK}` 。 异常: - **TypeError** - 如果 `sample_rate` 的类型不为int。 diff --git a/docs/api/api_python/mindspore/mindspore.JitConfig.rst b/docs/api/api_python/mindspore/mindspore.JitConfig.rst index f551f75f3eb..9cce4789f2d 100644 --- a/docs/api/api_python/mindspore/mindspore.JitConfig.rst +++ b/docs/api/api_python/mindspore/mindspore.JitConfig.rst @@ -1,7 +1,7 @@ mindspore.JitConfig ==================== -.. py:class:: mindspore.JitConfig(jit_level="O1", exc_mode=auto, **kwargs) +.. py:class:: mindspore.JitConfig(jit_level="O1", exc_mode="auto", **kwargs) 编译时所使用的JitConfig配置项。 diff --git a/docs/api/api_python/ops/mindspore.ops.func_addr.rst b/docs/api/api_python/ops/mindspore.ops.func_addr.rst index d974563316c..5e26afda701 100644 --- a/docs/api/api_python/ops/mindspore.ops.func_addr.rst +++ b/docs/api/api_python/ops/mindspore.ops.func_addr.rst @@ -1,7 +1,7 @@ mindspore.ops.addr ================== -.. py:function:: mindspore.ops.addr(vec1, vec2, beta=1, alpha=1) +.. py:function:: mindspore.ops.addr(x, vec1, vec2, beta=1, alpha=1) 计算 `vec1` 和 `vec2` 的外积,并将其添加到 `x` 中。 @@ -14,6 +14,7 @@ mindspore.ops.addr output = β x + α (vec1 ⊗ vec2) 参数: + - **x** (Tensor) - 需要相加的向量。Tensor的shape是 :math:`(N, M)` 。 - **vec1** (Tensor) - 第一个需要相乘的Tensor,shape大小为 :math:`(N,)` 。 - **vec2** (Tensor) - 第二个需要相乘的Tensor,shape大小为 :math:`(M,)` 。 - **beta** (scalar[int, float, bool], 可选) - `x` (β)的乘法器。 `beta` 必须是int或float或bool类型,默认值:1。 diff --git a/docs/api/api_python/ops/mindspore.ops.func_t.rst b/docs/api/api_python/ops/mindspore.ops.func_t.rst index f2b698588b3..992a2fc97f2 100644 --- a/docs/api/api_python/ops/mindspore.ops.func_t.rst +++ b/docs/api/api_python/ops/mindspore.ops.func_t.rst @@ -12,4 +12,4 @@ mindspore.ops.t Tensor,`x` 的转置。 异常: - - **TypeError** - `x` 的维度大于2。 + - **ValueError** - `x` 的维度大于2。 diff --git a/docs/api/api_python/ops/mindspore.ops.func_zeros.rst b/docs/api/api_python/ops/mindspore.ops.func_zeros.rst index 43068de7ce8..20612fd8259 100644 --- a/docs/api/api_python/ops/mindspore.ops.func_zeros.rst +++ b/docs/api/api_python/ops/mindspore.ops.func_zeros.rst @@ -7,7 +7,7 @@ mindspore.ops.zeros 参数: - **shape** (Union[tuple[int], int]) - 用来描述所创建的Tensor的 `shape` 。 - - **dtype** (:class:`mindspore.dtype`) - 用来描述所创建的Tensor的 `dtype`。如果为None,那么将会使用mindspore.float32。默认值:None。 + - **dtype** (:class:`mindspore.dtype`, 可选) - 用来描述所创建的Tensor的 `dtype`。如果为None,那么将会使用mindspore.float32。默认值:None。 返回: Tensor,dtype和shape由入参决定。 diff --git a/mindspore/python/mindspore/ops/function/math_func.py b/mindspore/python/mindspore/ops/function/math_func.py index a327d1e3c2e..646345cfb30 100644 --- a/mindspore/python/mindspore/ops/function/math_func.py +++ b/mindspore/python/mindspore/ops/function/math_func.py @@ -9314,7 +9314,7 @@ def sum(x, dim=None, keepdim=False, *, dtype=None): Returns: A Tensor, sum of elements over a given dim in `x`. - Raise: + Raises: TypeError: If `x` is not a Tensor. TypeError: If `dim` is not an int. ValueError: If `dim` is not in the range :math:`[-x.ndim, x.ndim)` . diff --git a/mindspore/python/mindspore/ops/operations/array_ops.py b/mindspore/python/mindspore/ops/operations/array_ops.py index da7c5e4c70f..3f2c2341152 100755 --- a/mindspore/python/mindspore/ops/operations/array_ops.py +++ b/mindspore/python/mindspore/ops/operations/array_ops.py @@ -1825,24 +1825,6 @@ class Argmax(Primitive): Refer to :func:`mindspore.ops.argmax` for more details. - If the shape of input tensor is :math:`(x_1, ..., x_N)`, the shape of the output tensor will be - :math:`(x_1, ..., x_{axis-1}, x_{axis+1}, ..., x_N)`. - - Args: - axis (int): Axis where the Argmax operation applies to. Default: -1. - output_type (:class:`mindspore.dtype`): An optional data type of `mindspore.dtype.int32` and - `mindspore.dtype.int64`. Default: `mindspore.dtype.int32`. - - Inputs: - - **input_x** (Tensor) - Input tensor. :math:`(N,*)` where :math:`*` means, any number of additional dimensions. - - Outputs: - Tensor, whose dtype is determined by `output_type`. - - Raises: - TypeError: If `axis` is not an int. - TypeError: If `output_type` is neither int32 nor int64. - Supported Platforms: ``Ascend`` ``GPU`` ``CPU`` @@ -5751,8 +5733,8 @@ class Sort(Primitive): - **x** (Tensor) - The input tensor of any dimension, with a type of float16 or float32. Outputs: - y1(Tensor), a tensor whose values are the sorted values, with the same shape and data type as input. - y2(Tensor), the indices of the elements in the original input tensor. Data type is int32. + - **y1** (Tensor) - A tensor whose values are the sorted values, with the same shape and data type as input. + - **y2** (Tensor) - the indices of the elements in the original input tensor. Data type is int32. Raises: TypeError: If `axis` is not an int.