Skip to content

Commit 1c3c53d

Browse files
authored
Merge pull request #157 from jiweibo/summary
add summary api doc
2 parents df44e20 + 9835171 commit 1c3c53d

File tree

4 files changed

+173
-4
lines changed

4 files changed

+173
-4
lines changed

docs/api_reference/c_api_doc/Config/OtherFunction.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,32 @@ printf("GLOG INFO is: %s\n", PD_ConfigGlogInfoDisabled(config) ? "True" : "False
199199
200200
// 销毁 Config 对象
201201
PD_ConfigDestroy(config);
202-
```
202+
```
203+
204+
# 查看config配置
205+
206+
API定义如下:
207+
208+
```c++
209+
// 返回config的配置信息
210+
// 参数:pd_config - Config 对象指针
211+
// 返回:const char* - config配置信息,注意用户需释放该指针。
212+
const char* PD_ConfigSummary(PD_Config* pd_config);
213+
```
214+
215+
代码示例:
216+
217+
```c
218+
// 创建 Config 对象
219+
PD_Config* config = PD_ConfigCreate();
220+
221+
const char* summary = PD_ConfigSummary(config);
222+
223+
printf("summary is %s\n", summary);
224+
225+
// 释放summary指针
226+
free(summary);
227+
228+
// 销毁 Config 对象
229+
PD_ConfigDestroy(config);
230+
```

docs/api_reference/cxx_api_doc/Config/OtherFunction.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,51 @@ config.DisableGlogInfo();
176176

177177
// 判断是否禁用 LOG - true
178178
std::cout << "GLOG INFO is: " << config.glog_info_disabled() << std::endl;
179-
```
179+
```
180+
181+
# 查看config配置
182+
183+
API定义如下:
184+
185+
```c++
186+
// 返回config的配置信息
187+
// 参数:None
188+
// 返回:string - config配置信息
189+
std::string Summary();
190+
```
191+
192+
调用Summary()的输出如下所示:
193+
```
194+
+-------------------------------+----------------------------------+
195+
| Option | Value |
196+
+-------------------------------+----------------------------------+
197+
| model_dir | ./inference_pass/TRTFlattenTest/ |
198+
+-------------------------------+----------------------------------+
199+
| cpu_math_thread | 1 |
200+
| enable_mkdlnn | false |
201+
| mkldnn_cache_capacity | 10 |
202+
+-------------------------------+----------------------------------+
203+
| use_gpu | true |
204+
| gpu_device_id | 0 |
205+
| memory_pool_init_size | 100MB |
206+
| thread_local_stream | false |
207+
| use_tensorrt | true |
208+
| tensorrt_precision_mode | fp32 |
209+
| tensorrt_workspace_size | 1073741824 |
210+
| tensorrt_max_batch_size | 32 |
211+
| tensorrt_min_subgraph_size | 0 |
212+
| tensorrt_use_static_engine | false |
213+
| tensorrt_use_calib_mode | false |
214+
| tensorrt_enable_dynamic_shape | false |
215+
| tensorrt_use_oss | true |
216+
| tensorrt_use_dla | false |
217+
+-------------------------------+----------------------------------+
218+
| use_xpu | false |
219+
+-------------------------------+----------------------------------+
220+
| ir_optim | true |
221+
| ir_debug | false |
222+
| memory_optim | false |
223+
| enable_profile | false |
224+
| enable_log | true |
225+
+-------------------------------+----------------------------------+
226+
```

docs/api_reference/go_api_doc/Config/OtherFunction.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,51 @@ func main() {
137137
// 去除 Paddle Inference 运行中的 LOG
138138
config.DisableGlogInfo();
139139
}
140-
```
140+
```
141+
142+
# 查看config配置
143+
144+
API定义如下:
145+
146+
```go
147+
// 返回config的配置信息
148+
// 参数:None
149+
// 返回:string - config配置信息
150+
func (config *Config) Summary() string
151+
```
152+
153+
调用Summary()的输出如下所示:
154+
```
155+
+-------------------------------+----------------------------------+
156+
| Option | Value |
157+
+-------------------------------+----------------------------------+
158+
| model_dir | ./inference_pass/TRTFlattenTest/ |
159+
+-------------------------------+----------------------------------+
160+
| cpu_math_thread | 1 |
161+
| enable_mkdlnn | false |
162+
| mkldnn_cache_capacity | 10 |
163+
+-------------------------------+----------------------------------+
164+
| use_gpu | true |
165+
| gpu_device_id | 0 |
166+
| memory_pool_init_size | 100MB |
167+
| thread_local_stream | false |
168+
| use_tensorrt | true |
169+
| tensorrt_precision_mode | fp32 |
170+
| tensorrt_workspace_size | 1073741824 |
171+
| tensorrt_max_batch_size | 32 |
172+
| tensorrt_min_subgraph_size | 0 |
173+
| tensorrt_use_static_engine | false |
174+
| tensorrt_use_calib_mode | false |
175+
| tensorrt_enable_dynamic_shape | false |
176+
| tensorrt_use_oss | true |
177+
| tensorrt_use_dla | false |
178+
+-------------------------------+----------------------------------+
179+
| use_xpu | false |
180+
+-------------------------------+----------------------------------+
181+
| ir_optim | true |
182+
| ir_debug | false |
183+
| memory_optim | false |
184+
| enable_profile | false |
185+
| enable_log | true |
186+
+-------------------------------+----------------------------------+
187+
```

docs/api_reference/python_api_doc/Config/OtherFunction.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,51 @@ config.disable_glog_info()
141141

142142
# 判断是否禁用 LOG - true
143143
print("GLOG INFO is: {}".format(config.glog_info_disabled()))
144-
```
144+
```
145+
146+
# 查看config配置
147+
148+
API定义如下:
149+
150+
```python
151+
# 返回config的配置信息
152+
# 参数:None
153+
# 返回:string - config配置信息
154+
paddle.inference.Config.summary()
155+
```
156+
157+
调用summary()的输出如下所示:
158+
```
159+
+-------------------------------+----------------------------------+
160+
| Option | Value |
161+
+-------------------------------+----------------------------------+
162+
| model_dir | ./inference_pass/TRTFlattenTest/ |
163+
+-------------------------------+----------------------------------+
164+
| cpu_math_thread | 1 |
165+
| enable_mkdlnn | false |
166+
| mkldnn_cache_capacity | 10 |
167+
+-------------------------------+----------------------------------+
168+
| use_gpu | true |
169+
| gpu_device_id | 0 |
170+
| memory_pool_init_size | 100MB |
171+
| thread_local_stream | false |
172+
| use_tensorrt | true |
173+
| tensorrt_precision_mode | fp32 |
174+
| tensorrt_workspace_size | 1073741824 |
175+
| tensorrt_max_batch_size | 32 |
176+
| tensorrt_min_subgraph_size | 0 |
177+
| tensorrt_use_static_engine | false |
178+
| tensorrt_use_calib_mode | false |
179+
| tensorrt_enable_dynamic_shape | false |
180+
| tensorrt_use_oss | true |
181+
| tensorrt_use_dla | false |
182+
+-------------------------------+----------------------------------+
183+
| use_xpu | false |
184+
+-------------------------------+----------------------------------+
185+
| ir_optim | true |
186+
| ir_debug | false |
187+
| memory_optim | false |
188+
| enable_profile | false |
189+
| enable_log | true |
190+
+-------------------------------+----------------------------------+
191+
```

0 commit comments

Comments
 (0)