TensorRT 10.8.0
|
网络定义中的 Softmax 层。 更多...
#include <NvInfer.h>
公共成员函数 | |
void | setAxes (uint32_t axes) noexcept |
设置计算 softmax 的轴。目前,只能设置一个轴。 更多... | |
uint32_t | getAxes () const noexcept |
获取 softmax 发生的轴。 更多... | |
![]() | |
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 | ~ISoftMaxLayer () 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::VSoftMaxLayer * | mImpl |
![]() | |
apiv::VLayer * | mLayer |
网络定义中的 Softmax 层。
此层对其输入应用逐通道的 softmax。
输出大小与输入大小相同。
必须满足以下约束才能在 DLA 上执行此层
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
获取 softmax 发生的轴。
|
inlinenoexcept |
设置计算 softmax 的轴。目前,只能设置一个轴。
轴通过设置与轴对应的位为 1 来指定。例如,考虑 NCHW 张量作为输入。
位 0 对应于 N 维度布尔值。位 1 对应于 C 维度布尔值。位 2 对应于 H 维度布尔值。位 3 对应于 W 维度布尔值。默认情况下,softmax 在轴数减三的轴上执行。如果轴数少于 3,则为 0。例如,如果输入是 NCHW,则默认轴是 C。如果输入是 NHW,则默认轴是 N。
例如,要在 NPQRCHW 输入的 R 轴上执行 softmax,请设置位 3。
axes | 计算 softmax 的轴。此处 axes 是一个位图。例如,当沿轴 0 执行 softmax 时,位 0 设置为 1,axes = 1 << axis = 1。 |
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍功能 | 公司政策 | 产品安全 | 联系我们