diff --git a/docs/source_en/constraints_on_network_construction.md b/docs/source_en/constraints_on_network_construction.md index 1deb78ee3947bf36b1b770aa4d4140901a0ed533..ae1297375d55d4004d07ebf13f4e022ca32c3786 100644 --- a/docs/source_en/constraints_on_network_construction.md +++ b/docs/source_en/constraints_on_network_construction.md @@ -19,6 +19,7 @@ - [Network Input Type](#network-input-type) - [Network Graph Optimization](#network-graph-optimization) - [Network Construction Components](#network-construction-components) + - [Mixed Mode](#mixed-mode) - [Other Constraints](#other-constraints) @@ -135,6 +136,9 @@ Currently, the following syntax is not supported in network constructors: | Composite operator |[mindspore/ops/composite/*](https://www.mindspore.cn/api/en/master/api/python/mindspore/mindspore.ops.composite.html). | Operator generated by constexpr |Uses the value generated by [@constexpr](https://www.mindspore.cn/api/en/master/api/python/mindspore/mindspore.ops.html#mindspore.ops.constexpr) to calculate operators. +### Mixed Mode + It is not recommended to use dynamic graph mode (PyNative) and static graph mode for network construction at the same time. + ### Other Constraints Input parameters of the construct function on the entire network and parameters of functions modified by the ms_function decorator are generalized during the graph compilation. Therefore, they cannot be transferred to operators as constant input, as shown in the following example: diff --git a/docs/source_zh_cn/constraints_on_network_construction.md b/docs/source_zh_cn/constraints_on_network_construction.md index b7a6d5cd0b3cd6a59fa99dd889b78260e7066897..41b59196b46dfe5913021a319f56a39b689b81d3 100644 --- a/docs/source_zh_cn/constraints_on_network_construction.md +++ b/docs/source_zh_cn/constraints_on_network_construction.md @@ -19,6 +19,7 @@ - [网络输入类型](#网络输入类型) - [网络图优化](#网络图优化) - [网络构造组件](#网络构造组件) + - [混合模式](#混合模式) - [其他约束](#其他约束) @@ -135,6 +136,8 @@ | Composite算子 |[mindspore/ops/composite/*](https://www.mindspore.cn/api/zh-CN/master/api/python/mindspore/mindspore.ops.composite.html) | constexpr生成算子 |使用[@constexpr](https://www.mindspore.cn/api/zh-CN/master/api/python/mindspore/mindspore.ops.html#mindspore.ops.constexpr)生成的值计算算子。 +### 混合模式 + 不建议同时使用静态图模式(PyNative)和动态图模式来构造网络。 ### 其他约束 整网construct函数输入的参数以及使用ms_function装饰器修饰的函数的参数在图编译过程中会进行泛化,不能作为常量输入传给算子使用,如下例所示: