函数 torch_tensorrt::torchscript::convert_method_to_trt_engine¶
函数文档¶
-
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运行。
- Parameters
模块 – torch::jit::Module - 现有的 TorchScript 模块
method_name – std::string - 要编译的方法名称
信息 – torch_tensorrt::CompileSpec - 编译设置
- Returns
: std::string: 序列化的 TensorRT 引擎,等同于方法图