DataType

tensorrt.DataType

Represents data types.

itemsize

int The size in bytes of this DataType .

Members:

HALF : Represents a 16-bit floating point number.

INT32 : Represents a 32-bit integer.

FLOAT : Represents a 32-bit floating point number.

BOOL : Represents a boolean.

INT8 : Represents an 8-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

tensorrt.DataType.BOOL

tensorrt.bool

tensorrt.nptype(trt_type)

Returns the numpy-equivalent of a TensorRT DataType .

Parameters

trt_type – The TensorRT data type to convert.

Returns

The equivalent numpy type.