函数 torch_tensorrt::torchscript::convert_method_to_trt_engine¶
定义在 文件 torch_tensorrt.h 中
函数文档¶
-
TORCHTRT_API std::string torch_tensorrt::torchscript::convert_method_to_trt_engine(const torch::jit::Module &module, std::string method_name, CompileSpec info)¶
使用 TensorRT 为 NVIDIA GPU 编译 TorchScript 方法。
接受现有的 TorchScript 模块和一组配置编译器的设置,并将选定的方法转换为可使用 TensorRT 运行的序列化 TensorRT 引擎。
- 参数
module – torch::jit::Module - 现有的 TorchScript 模块
method_name – std::string - 要编译的方法名称
info – torch_tensorrt::CompileSpec - 编译设置
- 返回值
: std::string: 与方法图等效的序列化 TensorRT 引擎