|
TensorRT 10.8.0
|
用于执行动态量化的网络层。 更多...
#include <NvInfer.h>
公有成员函数 | |
| void | setToType (DataType toType) noexcept |
| 设置 DynamicQuantizeLayer 的量化输出类型。 更多... | |
| DataType | getToType () const noexcept |
| 返回 DynamicQuantizeLayer 的量化输出类型。 更多... | |
| void | setScaleType (DataType scaleType) noexcept |
| 设置用于量化数据的缩放因子的数据类型。 更多... | |
| DataType | getScaleType () const noexcept |
| 返回缩放因子数据类型。 更多... | |
| void | setAxis (int32_t axis) noexcept |
| 设置块量化发生的轴。 更多... | |
| int32_t | getAxis () const noexcept |
| 获取块操作发生的轴。 更多... | |
| void | setBlockSize (int32_t size) noexcept |
| 设置量化块的大小。 更多... | |
| int32_t | getBlockSize () const noexcept |
| 获取量化块的大小。 更多... | |
| void | setInput (int32_t index, ITensor &tensor) 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 | ~IDynamicQuantizeLayer () 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::VDynamicQuantizeLayer * | mImpl |
继承自 nvinfer1::ILayer 的保护属性 | |
| apiv::VLayer * | mLayer |
用于执行动态量化的网络层。
此层接受浮点输入张量,并计算量化输入数据所需的块缩放因子。它将量化张量作为第一个输出,并将缩放因子作为第二个输出。
使用 ILayer::setInput 添加双重量化缩放因子的输入。
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
获取块操作发生的轴。
|
inlinenoexcept |
获取量化块的大小。
|
inlinenoexcept |
|
inlinenoexcept |
返回 DynamicQuantizeLayer 的量化输出类型。
返回值是量化输出张量的类型。默认值为 DataType::kFP4。
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
追加或替换此层的输入为指定的张量。
| index | 要修改的输入的索引。 |
| tensor | 新的输入张量 |
输入 0 是输入激活张量。输入 1 是双重量化缩放因子。此缩放因子用于量化动态计算的高精度缩放因子,这些因子用于量化激活数据。目前,此输入必须是正标量(0D 张量)。
|
inlinenoexcept |
|
inlinenoexcept |
设置 DynamicQuantizeLayer 的量化输出类型。
| toType | 量化输出张量的数据类型。 |
设置动态量化层的量化输出类型。目前唯一有效的值是 DataType::kFP4。如果网络是强类型的,则必须使用 setToType 设置输出类型,使用 setOutputType 是错误的。否则,传递给 setOutputType 和 setToType 的类型必须相同。
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍访问 | 公司政策 | 产品安全 | 联系方式