mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[docs] Update how_to_change_backend.md (#316)
Update how_to_change_backend.md
This commit is contained in:
@@ -9,7 +9,7 @@ FastDeploy中各视觉模型可支持多种后端,包括
|
|||||||
所有模型切换后端方式均通过RuntimeOption进行切换,
|
所有模型切换后端方式均通过RuntimeOption进行切换,
|
||||||
|
|
||||||
**Python**
|
**Python**
|
||||||
```
|
```python
|
||||||
import fastdeploy as fd
|
import fastdeploy as fd
|
||||||
option = fd.RuntimeOption()
|
option = fd.RuntimeOption()
|
||||||
|
|
||||||
@@ -26,14 +26,14 @@ option.use_ort_backend() # ONNX Runtime
|
|||||||
```
|
```
|
||||||
|
|
||||||
**C++**
|
**C++**
|
||||||
```
|
```C++
|
||||||
fastdeploy::RuntimeOption option;
|
fastdeploy::RuntimeOption option;
|
||||||
|
|
||||||
# 切换使用CPU/GPU
|
// 切换使用CPU/GPU
|
||||||
option.UseCpu();
|
option.UseCpu();
|
||||||
option.UseGpu();
|
option.UseGpu();
|
||||||
|
|
||||||
# 切换不同后端
|
// 切换不同后端
|
||||||
option.UsePaddleBackend(); // Paddle Inference
|
option.UsePaddleBackend(); // Paddle Inference
|
||||||
option.UseTrtBackend(); // TensorRT
|
option.UseTrtBackend(); // TensorRT
|
||||||
option.UseOpenVINOBackend(); // OpenVINO
|
option.UseOpenVINOBackend(); // OpenVINO
|
||||||
|
Reference in New Issue
Block a user