Represents data types.

itemsize:int The size in bytes of this DataType .


FLOAT : Represents a 32-bit floating point number.

HALF : Represents a 16-bit floating point number.

INT8 : Represents an 8-bit integer.

INT32 : Represents a 32-bit integer.

TensorRT also exposes some short-hand, NumPy-style DataType aliases that can be used across the library:

Type Alias
tensorrt.DataType.FLOAT tensorrt.float32
tensorrt.DataType.HALF tensorrt.float16
tensorrt.DataType.INT32 tensorrt.int32
tensorrt.DataType.INT8 tensorrt.int8

Returns the numpy-equivalent of a TensorRT DataType .

Parameters:trt_type – The TensorRT data type to convert.
Returns:The equivalent numpy type.