diff --git a/docs/mindspore/source_en/note/operator_list_implicit.md b/docs/mindspore/source_en/note/operator_list_implicit.md index 0115ba4e95fe368f95fcf63c8d8836fec19bccb5..dd00154aa9311db79f9d33eca2042e9f0bdd0df9 100644 --- a/docs/mindspore/source_en/note/operator_list_implicit.md +++ b/docs/mindspore/source_en/note/operator_list_implicit.md @@ -4,13 +4,13 @@ ## Implicit Type Conversion -### conversion rules +### Conversion Rules - Scalar and Tensor operations: during operation, the scalar is automatically converted to Tensor, and the data type is consistent with the Tensor data type involved in the operation; when Tensor is bool data type and the scalar is int or float, both the scalar and Tensor are converted to the Tensor with the data type of int32 or float32; when Tensor is int or uint data type and the scalar is float, both the scalar and Tensor are converted to the Tensor with the data type of float32. - Tensor operation of different data types: the priority of data type is bool < uint8 < int8 < int16 < int32 < int64 < float16 < float32 < float64, during the operation, first determine the data type with the relatively highest priority among the Tensors involved in the operation, and then convert the low priority data type Tensor to the relatively highest priority data type; when the Tensor of int8 and uint8 data types are operated, they are converted to int16 Tensor. - Data type conversion of Parameter is not supported: If inferred according to the conversion rules, RuntimeError exception will be thrown when the data type conversion of Parameter defined in the network is required. -### data types involved in conversion +### Data Types Involved in Conversion - bool - int8 diff --git a/docs/mindspore/source_en/note/operator_list_parallel.md b/docs/mindspore/source_en/note/operator_list_parallel.md index 69aab9a1ab80383dde108fbebff61f9acc0f4e2c..3758d0b7c94bc3edfaaf38863cbb912aa1ae9891 100644 --- a/docs/mindspore/source_en/note/operator_list_parallel.md +++ b/docs/mindspore/source_en/note/operator_list_parallel.md @@ -20,8 +20,8 @@ | [mindspore.ops.AssignSub](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.AssignSub.html) | None | | [mindspore.ops.Atan](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.Atan.html) | None | | [mindspore.ops.Atan2](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.Atan2.html) | None | -| [mindspore.ops.AvgPool](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.AvgPool.html) | 1. The data format only supports 'NCHW';
2. The shapes of output H/W dimension must be divisible by the split strategies of input H/W dimension;
3. If H/W is split:
1) If the kernel_size <= stride, the input slice size must be divisible by stride;
2) It does not support kernel_size > stride;
4. In auto_parallel mode, the strategy's searching algorithm can not use "recursive_programming". | | [mindspore.ops.Atanh](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.Atanh.html) | None | +| [mindspore.ops.AvgPool](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.AvgPool.html) | 1. The data format only supports 'NCHW';
2. The shapes of output H/W dimension must be divisible by the split strategies of input H/W dimension;
3. If H/W is split:
1) If the kernel_size <= stride, the input slice size must be divisible by stride;
2) It does not support kernel_size > stride;
4. In auto_parallel mode, the strategy's searching algorithm can not use "recursive_programming". | | [mindspore.ops.BatchMatMul](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.BatchMatMul.html) | `transpore_a=True` is not supported. | | [mindspore.ops.BatchNorm](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.BatchNorm.html) | It does not support GPU. | | [mindspore.ops.BesselI0e](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.BesselI0e.html) | None | diff --git a/docs/mindspore/source_en/note/static_graph_syntax_support.md b/docs/mindspore/source_en/note/static_graph_syntax_support.md index 2666db5042090075baee247d368ed19cb1ca0389..ac5d809ac58d2e8730507ee7f9fb28281e5ce9ee 100644 --- a/docs/mindspore/source_en/note/static_graph_syntax_support.md +++ b/docs/mindspore/source_en/note/static_graph_syntax_support.md @@ -38,7 +38,7 @@ Forcible conversion to `Number` is not supported on the network. That is, the sy `String` can be constructed on the network. That is, the syntax `y = "abcd"` is supported. -Can use str() to change the constant value to string, str.format() can use to format the string, but not supported to input a kwarts type arguments and the argument of format function cannot be a variable. +Use str() to change the constant value to string, str.format() can use to format the string, but not supported to input a kwarts type arguments and the argument of format function cannot be a variable. For example: @@ -271,7 +271,7 @@ The reference type of tuple is same as List, please refer to List. `values`: extracts all `value` values from `dict` to form `Tuple` and return it. - `items`: extracts `Tuple` composed of each pair of `value` values and `key` values in `dict` to form `Tuple` and return. + `items`: extracts `Tuple` composed of each pair of `value` values and `key` values in `dict` to form `Tuple` and return it. For example: @@ -381,11 +381,11 @@ The following describes the attributes, APIs supported by the `Tensor`. `any`: reduces `Tensor` through the `any` operation. Only `Tensor` of the `Bool` type is supported. -`view`: reshapes `Tensor` into input `shape`. + `view`: reshapes `Tensor` into input `shape`. - `expand_as`: expands `Tensor` to the same `shape` as another `Tensor` based on the broadcast rule. + `expand_as`: expands `Tensor` to the same `shape` as another `Tensor` based on the broadcast rule. - For example: + For example: ```python from mindspore import ms_function, Tensor @@ -421,7 +421,7 @@ The following describes the attributes, APIs supported by the `Tensor`. y_as_z:[[[1. 1. 1.] [1. 1. 1.]] - [[1. 1. 1.] + [[1. 1. 1.] [1. 1. 1.]]] ``` @@ -1169,7 +1169,7 @@ Calling: `map(func, sequence, ...)` Input parameters: -- `func` --Function. +- `func` -- Function. - `sequence` -- One or more sequences (`Tuple` or `List`). @@ -1338,9 +1338,9 @@ Calling: Input parameters: -- `type` --Class. +- `type` -- Class. -- `self` --Object. +- `self` -- Object. Return value: method of the parent class. @@ -1552,7 +1552,9 @@ ret:(Tensor(shape=[2, 3], dtype=Float32, value= [ 1.00000000e+00, 1.00000000e+00, 1.00000000e+00]])) ``` -In the `Net` defined above, string `flag` is transferred during initialization and saved as attribute `self.flag`, then used in the construct. The input parameter `x` and `z` are `Tensor`, `y` is `int`. While `grad_net` calculates gradient of the input parameters for the outermost network, gradient of `y` is automatically ignored, only the gradient of x and z is calculated, ret = (grad_x, grad_z). +In the `Net` defined above, `string` flag is transferred during initialization and saved as attribute `self.flag`, then used in the `construct`. + +The input parameter `x` and `z` are `Tensor`, `y` is `int`. While `grad_net` calculates gradient of the input parameters `(x, y, z)` for the outermost network, gradient of `y` is automatically ignored, only the gradient of `x` and `z` is calculated, `ret = (grad_x, grad_z)`. ### Instance Types on the Entire Network @@ -1562,15 +1564,15 @@ In the `Net` defined above, string `flag` is transferred during initialization ### Network Construction Components -| Category | Content -| :----------- |:-------- -| `Cell` instance |[mindspore/nn/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html) and user-defined [Cell](https://www.mindspore.cn/docs/en/master/api_python/nn/mindspore.nn.Cell.html). -| Member function of a `Cell` instance | Member functions of other classes in the construct function of Cell can be called. -| `ms_class` instance | Class decorated with [@ms_class](https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.ms_class.html). -| `Primitive` operator |[mindspore/ops/operations/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.ops.html) -| `Composite` operator |[mindspore/ops/composite/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.ops.html) -| `constexpr` generation operator | Value computation operator generated by [@constexpr](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.constexpr.html). -| Function | User-defined Python functions and system functions listed in the preceding content. +| Category | Content | +| :----------------------------------- | :----------------------------------------------------------- | +| `Cell` instance | [mindspore/nn/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html) and user-defined [Cell](https://www.mindspore.cn/docs/en/master/api_python/nn/mindspore.nn.Cell.html). | +| Member function of a `Cell` instance | Member functions of other classes in the construct function of Cell can be called. | +| `Primitive` operator | Class decorated with [@ms_class](https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.ms_class.html). | +| `Composite` operator | [mindspore/ops/operations/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.ops.html) | +| `constexpr` generation operator | [mindspore/ops/composite/*](https://www.mindspore.cn/docs/en/master/api_python/mindspore.ops.html) | +| `constexpr`生成算子 | Value computation operator generated by [@constexpr](https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.constexpr.html). | +| Function | User-defined Python functions and system functions listed in the preceding content. | ### Network Constraints diff --git a/docs/mindspore/source_zh_cn/note/static_graph_syntax_support.md b/docs/mindspore/source_zh_cn/note/static_graph_syntax_support.md index ec3d9556576c811d56666d50247b0134f03b819e..7aec10896be6242c81ec2aa8ae64ce44947777d6 100644 --- a/docs/mindspore/source_zh_cn/note/static_graph_syntax_support.md +++ b/docs/mindspore/source_zh_cn/note/static_graph_syntax_support.md @@ -554,7 +554,7 @@ ret:[[3. 3. 3. 3.]] | :------------- | :---------------------------------------------- | | `+` | `Number`、`Tensor`,取正值。 | | `-` | `Number`、`Tensor`,取负值。 | -| ~ | `Tensor`, 且其数据类型为`Bool`。成员逐个取反。 | +| `~` | `Tensor`, 且其数据类型为`Bool`。成员逐个取反。 | 说明: @@ -820,7 +820,7 @@ ret:[[7. 7. 7.] - 如果`cond`不为常量, 循环体内部不能更新循环体外的`Number`、`List`、`Tuple`类型数据, 不能更改`Tensor`类型数据的shape。 -- while的数量不能超过100个。 +- `while`的数量不能超过100个。 示例1: