評價此頁

LSTM#

class torch.ao.nn.quantized.dynamic.LSTM(*args, **kwargs)[原始碼]#

一個動態量化的LSTM模組,輸入和輸出均為浮點張量。我們採用了與torch.nn.LSTM相同的介面,請參閱https://pytorch.com.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))