@Namespace(value="nvinfer1") public static enum nvinfer.TensorFormat extends Enum<nvinfer.TensorFormat>
IPluginV2::supportsFormat(), safe::ICudaEngine::getBindingFormat()
Many of the formats are **vector-major** or **vector-minor**. These formats specify
a vector dimension and scalars per vector.
For example, suppose that the tensor has has dimensions [M,N,C,H,W],
the vector dimension is C and there are V scalars per vector.
* A **vector-major** format splits the vectorized dimension into two axes in the
memory layout. The vectorized dimension is replaced by an axis of length ceil(C/V)
and a new dimension of length V is appended. For the example tensor, the memory layout
is equivalent to an array with dimensions [M][N][ceil(C/V)][H][W][V].
Tensor coordinate (m,n,c,h,w) maps to array location [m][n][c/V][h][w][c\%V].
* A **vector-minor** format moves the vectorized dimension to become the last axis
in the memory layout. For the example tensor, the memory layout is equivalent to an
array with dimensions [M][N][H][W][ceil(C/V)*V]. Tensor coordinate (m,n,c,h,w) maps
array location subscript [m][n][h][w][c].
In interfaces that refer to "components per element", that's the value of V above.
For more information about data formats, see the topic "Data Format Description" located in the
TensorRT Developer Guide. https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#data-format-desc
Enum Constant and Description |
---|
kCDHW32
Vector-major format with 32 scalars per vector.
|
kCHW16
Vector-major format with 16 scalars per vector.
|
kCHW2
Vector-major format with two scalars per vector.
|
kCHW32
Vector-major format with 32 scalars per vector.
|
kCHW4
Vector-major format with four scalars per vector.
|
kDHWC
Vector-minor format with one scalar per vector.
|
kDHWC8
Vector-minor format with eight scalars per vector.
|
kDLA_HWC4
DLA image format.
|
kDLA_LINEAR
DLA planar format.
|
kHWC
Vector-minor format where channel dimension is third to last and unpadded.
|
kHWC16
Vector-minor format with 16 scalars per vector.
|
kHWC8
Vector-minor format with eight scalars per vector.
|
kLINEAR
Memory layout is similar to an array in C or C++.
|
Modifier and Type | Field and Description |
---|---|
int |
value |
Modifier and Type | Method and Description |
---|---|
nvinfer.TensorFormat |
intern() |
String |
toString() |
static nvinfer.TensorFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static nvinfer.TensorFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final nvinfer.TensorFormat kLINEAR
public static final nvinfer.TensorFormat kCHW2
public static final nvinfer.TensorFormat kHWC8
public static final nvinfer.TensorFormat kCHW4
public static final nvinfer.TensorFormat kCHW16
public static final nvinfer.TensorFormat kCHW32
public static final nvinfer.TensorFormat kDHWC8
public static final nvinfer.TensorFormat kCDHW32
public static final nvinfer.TensorFormat kHWC
public static final nvinfer.TensorFormat kDLA_LINEAR
public static final nvinfer.TensorFormat kDLA_HWC4
public static final nvinfer.TensorFormat kHWC16
public static final nvinfer.TensorFormat kDHWC
public static nvinfer.TensorFormat[] values()
for (nvinfer.TensorFormat c : nvinfer.TensorFormat.values()) System.out.println(c);
public static nvinfer.TensorFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic nvinfer.TensorFormat intern()
public String toString()
toString
in class Enum<nvinfer.TensorFormat>
Copyright © 2024. All rights reserved.