TensorRT 10.8.0
|
用于混洗数据的层类型。 更多...
#include <NvInfer.h>
公共成员函数 | |
void | setFirstTranspose (Permutation permutation) noexcept |
设置第一个转置操作应用的置换。 更多... | |
Permutation | getFirstTranspose () const noexcept |
获取第一个转置操作应用的置换。 更多... | |
void | setReshapeDimensions (Dims const &dimensions) noexcept |
设置重塑后的维度。 更多... | |
Dims | getReshapeDimensions () const noexcept |
获取重塑后的维度。 更多... | |
void | setSecondTranspose (Permutation permutation) noexcept |
设置第二个转置操作应用的置换。 更多... | |
Permutation | getSecondTranspose () const noexcept |
获取第二个转置操作应用的置换。 更多... | |
void | setZeroIsPlaceholder (bool zeroIsPlaceholder) noexcept |
设置重塑维度中 0 的含义。 更多... | |
bool | getZeroIsPlaceholder () const noexcept |
获取重塑维度中 0 的含义。 更多... | |
void | setInput (int32_t index, ITensor &tensor) noexcept |
为该层追加或替换一个特定的输入张量。 更多... | |
![]() | |
LayerType | getType () const noexcept |
返回层的类型。 更多... | |
void | setName (char const *name) noexcept |
设置层的名称。 更多... | |
char const * | getName () const noexcept |
返回层的名称。 更多... | |
int32_t | getNbInputs () const noexcept |
获取层的输入数量。 更多... | |
ITensor * | getInput (int32_t index) const noexcept |
获取给定索引对应的层输入。 更多... | |
int32_t | getNbOutputs () const noexcept |
获取层的输出数量。 更多... | |
ITensor * | getOutput (int32_t index) const noexcept |
获取给定索引对应的层输出。 更多... | |
void | setInput (int32_t index, ITensor &tensor) noexcept |
用特定的张量替换该层的输入。 更多... | |
void | setPrecision (DataType dataType) noexcept |
在弱类型网络中设置此层的首选或必需的计算精度。 更多... | |
DataType | getPrecision () const noexcept |
获取此层的计算精度 更多... | |
bool | precisionIsSet () const noexcept |
是否已为此层设置计算精度 更多... | |
void | resetPrecision () noexcept |
重置此层的计算精度 更多... | |
void | setOutputType (int32_t index, DataType dataType) noexcept |
在弱类型网络中设置此层的输出类型。 更多... | |
DataType | getOutputType (int32_t index) const noexcept |
获取此层的输出类型 更多... | |
bool | outputTypeIsSet (int32_t index) const noexcept |
是否已为此层设置输出类型 更多... | |
void | resetOutputType (int32_t index) noexcept |
重置此层的输出类型 更多... | |
void | setMetadata (char const *metadata) noexcept |
为此层设置元数据。 更多... | |
char const * | getMetadata () const noexcept |
获取层的元数据。 更多... | |
保护成员函数 | |
virtual | ~IShuffleLayer () noexcept=default |
![]() | |
virtual | ~ILayer () noexcept=default |
![]() | |
INoCopy ()=default | |
virtual | ~INoCopy ()=default |
INoCopy (INoCopy const &other)=delete | |
INoCopy & | operator= (INoCopy const &other)=delete |
INoCopy (INoCopy &&other)=delete | |
INoCopy & | operator= (INoCopy &&other)=delete |
保护属性 | |
apiv::VShuffleLayer * | mImpl |
![]() | |
apiv::VLayer * | mLayer |
用于混洗数据的层类型。
此层通过按顺序应用以下操作来混洗数据:转置操作、重塑操作和第二个转置操作。输出的维度类型与重塑维度相同。
该层有一个可选的第二个输入。如果存在,则它必须是 Int32 或 Int64 类型的 1D 张量,并且重塑维度从中获取。
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
为该层追加或替换一个特定的输入张量。
index | 要修改的输入的索引。 |
tensor | 新的输入张量。为给定索引设置输入张量。对于静态 shuffle 层,索引必须为 0。通过使用索引 1 调用 setInput,静态 shuffle 层将转换为动态 shuffle 层。动态 shuffle 层无法转换回静态 shuffle 层。 |
对于动态 shuffle 层,值 0 和 1 有效。动态情况下的索引如下:
如果使用值 1 调用此函数,则函数 getNbInputs() 的返回值将从 1 变为 2。
重塑维度的处理方式与通过 setReshapeDimensions 静态设置时的处理方式相同。 特别是,即使在运行时动态提供 -1,-1 也被视为通配符;如果 getZeroIsPlaceholder() = true(默认情况),则 0 被视为占位符。 如果不希望对 0 进行占位符解释,因为当重塑维度为 0 时,运行时维度应为 0,请务必在 IShuffleLayer 上调用 setZeroIsPlacholder(false)。
|
inlinenoexcept |
设置重塑后的维度。
dimensions | 重塑后的维度。 |
两个特殊值可以用作维度。
Value 0 从输入复制对应的维度。 此特殊值可以在维度中多次使用。 如果重塑维度的数量小于输入,则通过对齐输入的最重要维度来解析 0。
Value -1 通过查看输入和其余重塑维度来推断该特定维度。 请注意,最多允许将一个维度指定为 -1。 如果输入可能具有零体积,并且任何其他重塑维度都可能为零(在解析 0 的特殊处理之后),请避免使用 -1,因为 -1 的解将变为不确定,并且 TensorRT 将报告错误。
新维度的乘积必须等于旧维度的乘积。
如果已使用第二个输入来创建此层,则该输入将由此方法重置为空。
|
inlinenoexcept |
设置第二个转置操作应用的置换。
permutation | 在重塑之后应用的维度置换。 |
默认值为单位置换。
置换的应用方式为 outputDimensionIndex = permutation.order[inputDimensionIndex],因此要从 CHW 顺序置换为 HWC 顺序,所需的置换为 [1, 2, 0]。
|
inlinenoexcept |
设置重塑维度中 0 的含义。
如果为 true,则重塑维度中的 0 表示从第一个输入张量复制相应的维度。 如果为 false,则重塑维度中的 0 表示零长度维度。
默认值:true
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍访问 | 公司政策 | 产品安全 | 联系我们