快捷方式

Function 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 运行

参数
  • module – torch::jit::Module - 现有的 TorchScript 模块

  • method_name – std::string - 要编译的方法名称

  • info – torch_tensorrt::CompileSpec - 编译设置

返回值

: std::string: 序列化的 TensorRT 引擎,等效于方法图

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得问题解答

查看资源