LSTM¶
- class torch.ao.nn.quantized.dynamic.LSTM(*args, **kwargs)[原始碼][原始碼]¶
一個動態量化 LSTM 模組,具有浮點 tensor 作為輸入和輸出。 我們採用與 torch.nn.LSTM 相同的介面,請參閱 https://pytorch.dev.org.tw/docs/stable/nn.html#torch.nn.LSTM 以取得文件。
範例
>>> rnn = nn.LSTM(10, 20, 2) >>> input = torch.randn(5, 3, 10) >>> h0 = torch.randn(2, 3, 20) >>> c0 = torch.randn(2, 3, 20) >>> output, (hn, cn) = rnn(input, (h0, c0))