- `Summary`: briefly describes the API function. If the description begins with a verb, the module must use the same verb form, the first person (the original form of the verb) or the third person (add an "s" after the verb), and the first person is recommended.
- `More elaborate description`: describes the function and usage of an API in detail.
- `warning`: describes warnings for using an API to avoid negative consequences.
- `Note`: describes precautions for using an API. Do not use `Notes`.
@@ -89,6 +89,7 @@ Supported Platforms:
- The comment items required for a class or method are as follows: `Summary`, `Args`, `Returns`, and `Raises`. If a function does not contain related information (such as `Args`, `Returns`, and `Raises`), do not write None (for example, `Raises: None`), but directly omit the comment item.
- When an API is generated by directory, the comments in the \_\_init\_\_ file header are displayed at the beginning of the web page. When an API is generated by file, the comments at the beginning of the file are displayed at the beginning of the web page. The comments must contain the overall description of the corresponding modules.
- If a comment contains a backslash (\\), change `"""` in the header to `r"""`.
- If the comment begins with a verb, the module must use the same verb form, the first person (the original form of the verb) or the third person (add an "s" after the verb), and the first person is recommended.
- Colon requirements: Keywords (such as `Args` and `Returns`) and parameter names (such as `Arg1` or `Arg2`) are followed by colons (:). A colon must be followed by a space. The content of `Summary` and `Returns` cannot contain colons.
- Blank line requirements:
@@ -429,7 +430,7 @@ class Tensor(Tensor_):
...
```
For details about the display effect, click [here](https://www.mindspore.cn/doc/api_python/en/master/mindspore/mindspore.html#mindspore.Tensor).
For details about the display effect, click [here](https://www.mindspore.cn/docs/api/en/master/api_python/mindspore/mindspore.Tensor.html).
For details about the display effect, click [here](https://www.mindspore.cn/doc/api_python/en/master/mindspore/mindspore.html#mindspore.ms_function).
For details about the display effect, click [here](https://www.mindspore.cn/docs/api/en/master/api_python/mindspore/mindspore.ms_function.html).
#### Formula
@@ -491,7 +492,7 @@ class Conv2d(_Conv):
r"""
2D convolution layer.
Applies a 2D convolution over an input tensor which is typically of shape :math:`(N, C_{in}, H_{in}, W_{in})`,
Apply a 2D convolution over an input tensor which is typically of shape :math:`(N, C_{in}, H_{in}, W_{in})`,
where :math:`N` is batch size, :math:`C_{in}` is channel number, and :math:`H_{in}, W_{in})` are height and width.
For each batch of shape :math:`(C_{in}, H_{in}, W_{in})`, the formula is defined as:
@@ -503,7 +504,7 @@ class Conv2d(_Conv):
"""
```
For details about the display effect, click [here](https://www.mindspore.cn/doc/api_python/en/master/mindspore/mindspore.nn.html#mindspore.nn.Conv2d).
For details about the display effect, click [here](https://www.mindspore.cn/docs/api/en/master/api_python/nn/mindspore.nn.Conv2d.html).
#### Link
@@ -523,12 +524,12 @@ class BatchNorm(PrimitiveWithInfer):
"""
```
For details about the display effect, click [here](https://www.mindspore.cn/doc/api_python/en/master/mindspore/mindspore.ops.html#mindspore.ops.BatchNorm).
For details about the display effect, click [here](https://www.mindspore.cn/docs/api/en/master/api_python/ops/mindspore.ops.BatchNorm.html).
## C++ API Comment Specifications
- The name of the Markdown file must be the same as that of the namespace.
- The internal format of the Markdown file is as follows. For details, see [Sample](https://www.mindspore.cn/doc/api_cpp/en/master/lite.html).
- The internal format of the Markdown file is as follows. For details, see [Sample](https://www.mindspore.cn/lite/api/en/master/api_cpp/mindspore.html).