Linear¶
- class torch.ao.nn.quantized.dynamic.Linear(in_features, out_features, bias_=True, dtype=torch.qint8)[源代码][源代码]¶
一个动态量化线性模块,输入和输出均为浮点张量。我们采用与 torch.nn.Linear 相同的接口,请参阅 https://pytorch.ac.cn/docs/stable/nn.html#torch.nn.Linear 获取文档。
与
torch.nn.Linear
类似,属性将在模块创建时随机初始化,稍后将被覆盖示例
>>> m = nn.quantized.dynamic.Linear(20, 30) >>> input = torch.randn(128, 20) >>> output = m(input) >>> print(output.size()) torch.Size([128, 30])