評價此頁

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.com.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)