GRUCell¶
- class torch.ao.nn.quantized.dynamic.GRUCell(input_size, hidden_size, bias=True, dtype=torch.qint8)[原始碼][原始碼]¶
一個閘門循環單元 (GRU) 儲存格
一個動態量化的 GRUCell 模組,使用浮點張量作為輸入和輸出。權重被量化為 8 位元。 我們採用與 torch.nn.GRUCell 相同的介面,請參閱 https://pytorch.dev.org.tw/docs/stable/nn.html#torch.nn.GRUCell 取得相關文件。
範例
>>> rnn = nn.GRUCell(10, 20) >>> input = torch.randn(6, 3, 10) >>> hx = torch.randn(3, 20) >>> output = [] >>> for i in range(6): ... hx = rnn(input[i], hx) ... output.append(hx)