From e4000470cf774710dbf1e041e9f1db9d69ea5443 Mon Sep 17 00:00:00 2001 From: zhangyi Date: Thu, 25 Feb 2021 15:33:24 +0800 Subject: [PATCH] fix error format of docstrings for some api comments. --- mindspore/common/initializer.py | 8 ++++---- mindspore/context.py | 10 +++++----- mindspore/train/callback/_summary_collector.py | 2 +- mindspore/train/summary/summary_record.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mindspore/common/initializer.py b/mindspore/common/initializer.py index 42c2a186069..e954de69ffc 100644 --- a/mindspore/common/initializer.py +++ b/mindspore/common/initializer.py @@ -229,10 +229,10 @@ class XavierUniform(Initializer): Initialize the array with xavier uniform algorithm, and from a uniform distribution collect samples within U[-boundary, boundary] The boundary is defined as : - where :math:`boundary = gain * \sqrt{\frac{6}{n_{in} + n_{out}}}`. + where :math:`boundary = gain * \sqrt{\frac{6}{n_{in} + n_{out}}}`. - where :math:`n_{in}` is the number of input units in the weight tensor. - where :math:`n_{out}` is the number of output units in the weight tensor. + - where :math:`n_{in}` is the number of input units in the weight tensor. + - where :math:`n_{out}` is the number of output units in the weight tensor. Args: gain (Array): The array to be assigned. Default: 1. @@ -259,7 +259,7 @@ class HeUniform(Initializer): Initialize the array with He kaiming uniform algorithm, and from a uniform distribution collect samples within U[-boundary, boundary] The boundary is defined as : - where :math:`boundary = \sqrt{\frac{6}{(1 + a^2) \times \text{fan_in}}}`. + where :math:`boundary = \sqrt{\frac{6}{(1 + a^2) \times \text{fan_in}}}`. Args: negative_slope (int, float, bool): Default: 0, used when nonlinearity is 'leaky_relu'. diff --git a/mindspore/context.py b/mindspore/context.py index 65deea54915..4ea8c23373a 100644 --- a/mindspore/context.py +++ b/mindspore/context.py @@ -682,11 +682,11 @@ class ParallelMode: There are five kinds of parallel modes, "STAND_ALONE", "DATA_PARALLEL", "HYBRID_PARALLEL", "SEMI_AUTO_PARALLEL" and "AUTO_PARALLEL". Default: "STAND_ALONE". - - STAND_ALONE: Only one processor is working. - - DATA_PARALLEL: Distributes the data across different processors. - - HYBRID_PARALLEL: Achieves data parallelism and model parallelism manually. - - SEMI_AUTO_PARALLEL: Achieves data parallelism and model parallelism by setting parallel strategies. - - AUTO_PARALLEL: Achieves parallelism automatically. + - STAND_ALONE: Only one processor is working. + - DATA_PARALLEL: Distributes the data across different processors. + - HYBRID_PARALLEL: Achieves data parallelism and model parallelism manually. + - SEMI_AUTO_PARALLEL: Achieves data parallelism and model parallelism by setting parallel strategies. + - AUTO_PARALLEL: Achieves parallelism automatically. MODE_LIST: The list of all supported parallel modes. """ diff --git a/mindspore/train/callback/_summary_collector.py b/mindspore/train/callback/_summary_collector.py index 45f7b3a223f..51aba7cb221 100644 --- a/mindspore/train/callback/_summary_collector.py +++ b/mindspore/train/callback/_summary_collector.py @@ -138,7 +138,7 @@ class SummaryCollector(Callback): - tensor_format (Union[str, None]): Customize the export tensor format. Supports ["npy", None]. Default: None, it means that the tensor is not exported. - - npy: export tensor as npy file. + - npy: export tensor as npy file. Raises: ValueError: If the parameter value is not expected. diff --git a/mindspore/train/summary/summary_record.py b/mindspore/train/summary/summary_record.py index faac49897a7..3ca30ed4937 100644 --- a/mindspore/train/summary/summary_record.py +++ b/mindspore/train/summary/summary_record.py @@ -123,7 +123,7 @@ class SummaryRecord: - tensor_format (Union[str, None]): Customize the export tensor format. Supports ["npy", None]. Default: None, it means that the tensor is not exported. - - npy: export tensor as npy file. + - npy: export tensor as npy file. Raises: TypeError: If the parameter type is incorrect.