DataType
- tensorrt.DataType
Represents data types.
- ivar itemsize
int
The size in bytes of thisDataType
.
Members:
FLOAT : 32-bit floating point format.
HALF : IEEE 16-bit floating-point format.
BF16 : Brain float – has an 8 bit exponent and 8 bit significand
INT8 : Signed 8-bit integer representing a quantized floating-point value.
INT32 : Signed 32-bit integer format.
INT64 : Signed 64-bit integer format.
BOOL : 8-bit boolean. 0 = false, 1 = true, other values undefined.
- UINT8 :
Unsigned 8-bit integer format. Cannot be used to represent quantized floating-point values. Use the IdentityLayer to convert
uint8
network-level inputs to {float32
,float16
} prior to use with other TensorRT layers, or to convert intermediate output beforeuint8
network-level outputs from {float32
,float16
} touint8
.uint8
conversions are only supported for {float32
,float16
}.uint8
to {float32
,float16
} conversion will convert the integer values to equivalent floating point values. {float32
,float16
} touint8
conversion will convert the floating point values to integer values by truncating towards zero. This conversion has undefined behavior for floating point values outside the range [0.0f, 256.0) after truncation.uint8
conversions are not supported for {int8
,int32
,bool
}.- FP8 :
Signed 8-bit floating point with 1 sign bit, 4 exponent bits, 3 mantissa bits, and exponent-bias 7.
INT4 : Signed 4-bit integer representing a quantized floating-point value.
TensorRT also exposes some short-hand, NumPy-style DataType
aliases that can be used across the library:
Type |
Alias |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|