Linear¶
- class torch.ao.nn.quantized.dynamic.Linear(in_features, out_features, bias_=True, dtype=torch.qint8)[source][source]¶
一種動態量化的線性模組,使用浮點張量作為輸入和輸出。我們採用與 torch.nn.Linear 相同的介面,請參閱 https://pytorch.dev.org.tw/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])