aitune.torch.backend.tensorrt.tensorrt_profile

View as Markdown

TensorRT Profile for specifying optimization profiles.

Module Contents

Classes

NameDescription
TensorRTProfileClass for representing a TensorRT optimization profile.

Data

logger

API

class aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile()

Class for representing a TensorRT optimization profile.

This class provides an interface for defining optimization profiles for TensorRT engines with dynamic shapes.

_profile
= Profile()
profile
Profile

Get the underlying Polygraphy Profile.

Check if two TensorRTProfiles are equal.

aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile.__hash__() -> int

Hash the TensorRTProfile.

aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile.__repr__() -> str

Return the official string representation of the profile.

Returns: str

Official string representation

aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile.__str__() -> str

Return string representation of the profile.

Returns: str

String representation

Add a shape binding to the profile.

Parameters:

path
ForwardInputPath

Forward parameter path identifying the input tensor

min_shape
tuple[int, ...]

The minimum shape the profile will support

opt_shape
tuple[int, ...]

The shape for which TensorRT will tune the engine

max_shape
tuple[int, ...]

The maximum shape the profile will support

Returns: TensorRTProfile

The profile object for chaining

classmethod

Create TensorRTProfile from dictionary.

aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile.profile_to_dict(
profile: polygraphy.backend.trt.Profile
) -> dict
classmethod

Convert Polygraphy Profile to dictionary.

aitune.torch.backend.tensorrt.tensorrt_profile.TensorRTProfile.to_dict() -> dict

Convert TensorRTProfile to dictionary.

aitune.torch.backend.tensorrt.tensorrt_profile.logger = logging.getLogger(__name__)