mmdeploy/backend/tensorrt/utils.py
def load_trt_engine(path: str) -> trt.ICudaEngine:
    """Deserialize TensorRT engine from disk.

    Args:
        path (str): The disk path to read the engine.

    Returns:
        tensorrt.ICudaEngine: The TensorRT engine loaded from disk.
    """
    load_tensorrt_plugin()
    with trt.Logger() as logger, trt.Runtime(logger) as runtime:
        with open(path, mode='rb') as f:
            engine_bytes = f.read()
        engine = runtime.deserialize_cuda_engine(engine_bytes)
        return engine
Deserialize TensorRT engine from disk.

    Args:
        path (str): The disk path to read the engine.

    Returns:
        tensorrt.ICudaEngine: The TensorRT engine loaded from disk.
    
Deserialize TensorRT engine from disk.
Deserialize TensorRT engine from disk .
def load_trt_engine(path: str) -> trt.ICudaEngine:
    load_tensorrt_plugin()
    with trt.Logger() as logger, trt.Runtime(logger) as runtime:
        with open(path, mode='rb') as f:
            engine_bytes = f.read()
        engine = runtime.deserialize_cuda_engine(engine_bytes)
        return engine
def load_trt_engine ( path : str ) -> trt . ICudaEngine : load_tensorrt_plugin ( ) with trt . Logger ( ) as logger , trt . Runtime ( logger ) as runtime : with open ( path , mode = 'rb' ) as f : engine_bytes = f . read ( ) engine = runtime . deserialize_cuda_engine ( engine_bytes ) return engine
Deserialize TensorRT engine from disk.
Deserialize TensorRT engine from disk .
"""Deserialize TensorRT engine from disk.

    Args:
        path (str): The disk path to read the engine.

    Returns:
        tensorrt.ICudaEngine: The TensorRT engine loaded from disk.
    """
The TensorRT engine loaded from disk.
The TensorRT engine loaded from disk .
tensorrt.ICudaEngine
path
str
The disk path to read the engine.
The disk path to read the engine .