Skip to content

# Function trtorch::ConvertGraphToTRTEngine

- Defined in File trtorch.h

## Function Documentation

TRTORCH_API std::string `trtorch `::`` `ConvertGraphToTRTEngine` ( const torch::jit::Module & module , std::string method_name , CompileSpec info )

  Compile a TorchScript method for NVIDIA GPUs using TensorRT.

  Takes a existing TorchScript module and a set of settings to configure the compiler and will convert selected method to a serialized TensorRT engine which can be run with TensorRT

  Parameters

    - `module` : torch::jit::Module - Existing TorchScript module

    - `method_name` : std::string - Name of method to compile

    - `info` : trtorch::CompileSpec - Compilation settings

  Return

    : std::string: Serialized TensorRT engine equivilant to the method graph