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