TensorRT 10.8.0
|
网络中的 Einsum 层。 更多...
#include <NvInfer.h>
公共成员函数 | |
bool | setEquation (char const *equation) noexcept |
设置方程。方程是以逗号分隔的下标标签列表,其中每个标签引用相应张量的维度。 更多... | |
char const * | getEquation () const 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 | ~IEinsumLayer () 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::VEinsumLayer * | mImpl |
![]() | |
apiv::VLayer * | mLayer |
网络中的 Einsum 层。
此层根据爱因斯坦求和约定,对输入元素沿由 equation 参数指定的维度进行求和。该层可以有一个或多个 rank >= 0 的输入。所有输入必须具有 DataType::kFLOAT 或 DataType::kHALF 类型,不一定相同。有一个类型为 DataType::kFLOAT 的输出。输出张量的形状由方程确定。
方程为每个输入中的每个维度指定 ASCII 小写字母,维度顺序与输入顺序相同,每个输入之间用逗号分隔。用相同下标标记的维度必须匹配或可广播。一个输入中重复的下标标签取对角线。跨多个输入重复标签意味着这些轴将被相乘。从输出中省略标签意味着将对沿这些轴的值求和。在隐式模式下,表达式中出现一次的索引将按字母顺序递增成为输出的一部分。在显式模式下,可以通过添加箭头 ('->') 后跟输出的下标来控制输出。例如,“ij,jk->ik” 等价于 “ij,jk”。省略号 ('...') 可以用来代替下标来广播维度。有关方程语法的更多详细信息,请参阅 TensorRT 开发者指南。
许多常见操作可以使用 Einsum 方程表示。例如: 矩阵转置:ij->ji 求和:ij-> 矩阵-矩阵乘法:ik,kj->ij 点积:i,i-> 矩阵-向量乘法:ik,k->i 批矩阵乘法:ijk,ikl->ijl 批对角线:...ii->...i
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
返回方程。
|
inlinenoexcept |
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 辅助功能 | 公司政策 | 产品安全 | 联系我们