From 25c83e1f1749782fa84e9e6aa5f7c790e32d7121 Mon Sep 17 00:00:00 2001 From: fengshuai Date: Tue, 25 May 2021 20:59:53 +0800 Subject: [PATCH] delete InternaUse.md --- .../cxx_api_doc/Config/InternalUse.md | 66 ------------------- .../cxx_api_doc/Config_index.rst | 1 - .../python_api_doc/Config/InternalUse.md | 54 --------------- .../python_api_doc/Config_index.rst | 1 - 4 files changed, 122 deletions(-) delete mode 100644 docs/api_reference/cxx_api_doc/Config/InternalUse.md delete mode 100644 docs/api_reference/python_api_doc/Config/InternalUse.md diff --git a/docs/api_reference/cxx_api_doc/Config/InternalUse.md b/docs/api_reference/cxx_api_doc/Config/InternalUse.md deleted file mode 100644 index 66bf741adbdea..0000000000000 --- a/docs/api_reference/cxx_api_doc/Config/InternalUse.md +++ /dev/null @@ -1,66 +0,0 @@ -# 仅供内部使用 - -API定义如下: - -```c++ -// 转化为 NativeConfig,不推荐使用 -// 参数:None -// 返回:当前 Config 对应的 NativeConfig -NativeConfig ToNativeConfig() const; - -// 设置是否使用Feed, Fetch OP,仅内部使用 -// 当使用 ZeroCopyTensor 时,需设置为 false -// 参数:x - 是否使用Feed, Fetch OP,默认为 true -// 返回:None -void SwitchUseFeedFetchOps(int x = true); - -// 判断是否使用Feed, Fetch OP -// 参数:None -// 返回:bool - 是否使用Feed, Fetch OP -bool use_feed_fetch_ops_enabled() const; - -// 设置是否需要指定输入 Tensor 的 Name,仅对内部 ZeroCopyTensor 有效 -// 参数:x - 是否指定输入 Tensor 的 Name,默认为 true -// 返回:None -void SwitchSpecifyInputNames(bool x = true); - -// 判断是否需要指定输入 Tensor 的 Name,仅对内部 ZeroCopyTensor 有效 -// 参数:None -// 返回:bool - 是否需要指定输入 Tensor 的 Name -bool specify_input_name() const; - -// 设置 Config 为无效状态,仅内部使用,保证每一个 Config 仅用来初始化一次 Predictor -// 参数:None -// 返回:None -void SetInValid(); - -// 判断当前 Config 是否有效 -// 参数:None -// 返回:bool - 当前 Config 是否有效 -bool is_valid() const; -``` - -代码示例: - -```c++ -// 创建 Config 对象 -paddle_infer::Config config(FLAGS_infer_model + "/mobilenet"); - -// 转化为 NativeConfig -auto native_config = analysis_config->ToNativeConfig(); - -// 禁用 Feed, Fetch OP -config.SwitchUseFeedFetchOps(false); -// 返回是否使用 Feed, Fetch OP - false -std::cout << "UseFeedFetchOps is: " << config.use_feed_fetch_ops_enabled() << std::endl; - -// 设置需要指定输入 Tensor 的 Name -config.SwitchSpecifyInputNames(true); -// 返回是否需要指定输入 Tensor 的 Name - true -std::cout << "Specify Input Name is: " << config.specify_input_name() << std::endl; - -// 设置 Config 为无效状态 -config.SetInValid(); -// 判断当前 Config 是否有效 - false -std::cout << "Config validation is: " << config.is_valid() << std::endl; -``` \ No newline at end of file diff --git a/docs/api_reference/cxx_api_doc/Config_index.rst b/docs/api_reference/cxx_api_doc/Config_index.rst index 977945ad8ed91..3327721841d30 100644 --- a/docs/api_reference/cxx_api_doc/Config_index.rst +++ b/docs/api_reference/cxx_api_doc/Config_index.rst @@ -12,4 +12,3 @@ Config 类 Config/XPUConfig Config/OptimConfig Config/OtherFunction - Config/InternalUse \ No newline at end of file diff --git a/docs/api_reference/python_api_doc/Config/InternalUse.md b/docs/api_reference/python_api_doc/Config/InternalUse.md deleted file mode 100644 index 78d17ffa5e6ee..0000000000000 --- a/docs/api_reference/python_api_doc/Config/InternalUse.md +++ /dev/null @@ -1,54 +0,0 @@ -# 仅供内部使用 - -API定义如下: - -```python -# 转化为 NativeConfig,不推荐使用 -# 参数:None -# 返回:当前 Config 对应的 NativeConfig -paddle.inference.Config.to_native_config() - -# 设置是否使用Feed, Fetch OP,仅内部使用 -# 当使用 ZeroCopyTensor 时,需设置为 false -# 参数:x - 是否使用Feed, Fetch OP,默认为 true -# 返回:None -paddle.inference.Config.switch_use_feed_fetch_ops(x: bool = True) - -# 判断是否使用Feed, Fetch OP -# 参数:None -# 返回:bool - 是否使用Feed, Fetch OP -paddle.inference.Config.use_feed_fetch_ops_enabled() - -# 设置是否需要指定输入 Tensor 的 Name,仅对内部 ZeroCopyTensor 有效 -# 参数:x - 是否指定输入 Tensor 的 Name,默认为 true -# 返回:None -paddle.inference.Config.switch_specify_input_names(x: bool = True) - -# 判断是否需要指定输入 Tensor 的 Name,仅对内部 ZeroCopyTensor 有效 -# 参数:None -# 返回:bool - 是否需要指定输入 Tensor 的 Name -paddle.inference.Config.specify_input_name() -``` - -代码示例: - -```python -# 引用 paddle inference 预测库 -import paddle.inference as paddle_infer - -# 创建 config -config = paddle_infer.Config("./mobilenet_v1") - -# 转化为 NativeConfig -native_config = config.to_native_config() - -# 禁用 Feed, Fetch OP -config.switch_use_feed_fetch_ops(False) -# 返回是否使用 Feed, Fetch OP - false -print("switch_use_feed_fetch_ops is: {}".format(config.use_feed_fetch_ops_enabled())) - -# 设置需要指定输入 Tensor 的 Name -config.switch_specify_input_names(True) -# 返回是否需要指定输入 Tensor 的 Name - true -print("specify_input_name is: {}".format(config.specify_input_name())) -``` \ No newline at end of file diff --git a/docs/api_reference/python_api_doc/Config_index.rst b/docs/api_reference/python_api_doc/Config_index.rst index 977945ad8ed91..3327721841d30 100644 --- a/docs/api_reference/python_api_doc/Config_index.rst +++ b/docs/api_reference/python_api_doc/Config_index.rst @@ -12,4 +12,3 @@ Config 类 Config/XPUConfig Config/OptimConfig Config/OtherFunction - Config/InternalUse \ No newline at end of file