Shortcuts

函数 torch_tensorrt::torchscript::compile

函数文档

TORCHTRT_API torch::jit::Module torch_tensorrt::torchscript::compile(const torch::jit::Module &module, CompileSpec info)

使用TensorRT为NVIDIA GPU编译TorchScript模块。

获取一个现有的TorchScript模块和一组设置来配置编译器,并将方法转换为调用等效TensorRT引擎的JIT图

专门转换TorchScript模块的前向方法

Parameters
  • 模块 – torch::jit::Module - 现有的 TorchScript 模块

  • 信息 – torch_tensorrt::CompileSpec - 编译设置

Returns

: 一个新的模块,目标是TensorRT引擎