[Example] Update runtime examples (#1542)

* Add notes for tensors

* Optimize some apis

* move some warnings
This commit is contained in:
Jason
2023-03-08 16:56:04 +08:00
committed by GitHub
parent 3d31834193
commit 6be2c0367b
17 changed files with 425 additions and 277 deletions

View File

@@ -33,9 +33,8 @@ struct TrtBackendOption {
/// Enable log while converting onnx model to tensorrt
bool enable_log_info = false;
/*
* @brief Enable half precison inference, on some device not support half precision, it will fallback to float32 mode
*/
/// Enable half precison inference, on some device not support half precision, it will fallback to float32 mode
bool enable_fp16 = false;
/** \brief Set shape range of input tensor for the model that contain dynamic input shape while using TensorRT backend
@@ -64,9 +63,7 @@ struct TrtBackendOption {
max_shape[tensor_name].assign(max.begin(), max.end());
}
}
/**
* @brief Set cache file path while use TensorRT backend. Loadding a Paddle/ONNX model and initialize TensorRT will take a long time, by this interface it will save the tensorrt engine to `cache_file_path`, and load it directly while execute the code again
*/
/// Set cache file path while use TensorRT backend. Loadding a Paddle/ONNX model and initialize TensorRT will take a long time, by this interface it will save the tensorrt engine to `cache_file_path`, and load it directly while execute the code again
std::string serialize_file = "";
// The below parameters may be removed in next version, please do not