torch.nn.functional.linear
-
torch.nn.functional.linear(input, weight, bias=None) → Tensor
对传入数据进行线性变换: y=xAT+b .
此操作支持 2-D weight
稀疏布局
警告
稀疏支持是测试版功能,某些布局(s)/dtype/设备组合可能不受支持,或者可能没有自动微分支持。如果您发现缺少功能,请提交功能请求。
此运算符支持 TensorFloat32。
形状:
输入: (∗,in_features) 其中 * 表示包括零个在内的任意多个维度
重量: (out_features,in_features) 或 (in_features)
偏置: (out_features) 或 ()
输出: (∗,out_features) 或 (∗) ,基于权重的形状