|
TensorRT 10.8.0
|
网络定义中的 Scale 层。 更多...
#include <NvInfer.h>
公共成员函数 | |
| void | setMode (ScaleMode mode) noexcept |
| 设置缩放模式。 更多... | |
| ScaleMode | getMode () const noexcept |
| 获取缩放模式。 更多... | |
| void | setShift (Weights shift) noexcept |
| 设置偏移值。 更多... | |
| Weights | getShift () const noexcept |
| 获取偏移值。 更多... | |
| void | setScale (Weights scale) noexcept |
| 设置缩放值。 更多... | |
| Weights | getScale () const noexcept |
| 获取缩放值。 更多... | |
| void | setPower (Weights power) noexcept |
| 设置幂值。 更多... | |
| Weights | getPower () const noexcept |
| 获取幂值。 更多... | |
| int32_t | getChannelAxis () const noexcept |
| 获取通道轴。 更多... | |
| void | setChannelAxis (int32_t channelAxis) noexcept |
| 设置通道轴。 更多... | |
继承自 nvinfer1::ILayer 的公共成员函数 | |
| 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 | ~IScaleLayer () noexcept=default |
继承自 nvinfer1::ILayer 的受保护的成员函数 | |
| virtual | ~ILayer () noexcept=default |
继承自 nvinfer1::INoCopy 的受保护的成员函数 | |
| 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::VScaleLayer * | mImpl |
继承自 nvinfer1::ILayer 的受保护的属性 | |
| apiv::VLayer * | mLayer |
网络定义中的 Scale 层。
此层对其输入应用逐元素计算
output = (input* scale + shift)^ power
系数可以按每张量、每通道或每元素的方式应用。
输出大小与输入大小相同。
如果输出被约束为 INT8,而输入为 FP32,则 Scale 层可以用作图中的 INT8 量化节点。量化将关系舍入为偶数,并钳制到 [-128, 127]。
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
获取通道轴。
该值是输入张量维度中通道轴的索引。当启用 ScaleMode::kCHANNEL 时,缩放沿通道轴发生。
|
inlinenoexcept |
获取幂值。
|
inlinenoexcept |
获取缩放值。
|
inlinenoexcept |
获取偏移值。
|
inlinenoexcept |
设置通道轴。
该值是输入张量维度中通道轴的索引。
对于 ScaleMode::kCHANNEL,每个通道坐标可以有不同的缩放、偏移和幂权重。对于 ScaleMode::kELEMENTWISE,从通道轴及其后的轴的每个坐标组合可以有不同的缩放、偏移和幂权重。
例如,假设输入张量的维度为 [10,20,30,40],通道轴为 1。令 [n,c,h,w] 表示输入坐标。对于 ScaleMode::kCHANNEL,缩放、偏移和幂权重由 c 索引。对于 ScaleMode::kELEMENTWISE,缩放、偏移和幂权重由 [c,h,w] 索引。
|
inlinenoexcept |
设置幂值。
|
inlinenoexcept |
设置缩放值。
|
inlinenoexcept |
设置偏移值。
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 辅助功能 | 公司政策 | 产品安全 | 联系我们