LSTM¶
- class torch.ao.nn.quantized.dynamic.LSTM(*args, **kwargs)[source]¶
一个动态量化的 LSTM 模块,输入和输出为浮点张量。我们采用与 torch.nn.LSTM 相同的接口,请参阅 https://pytorch.ac.cn/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))