LSTMCell ¬
- class torch.ao.nn.quantized.dynamic.LSTMCell(*args, **kwargs)[source][source] ¬
长短期记忆(LSTM)单元。
一个以浮点张量作为输入和输出的动态量化 LSTMCell 模块。权重量化为 8 位。我们采用与 torch.nn.LSTMCell 相同的接口,请参阅 https://pytorch.org/docs/stable/nn.html#torch.nn.LSTMCell 以获取文档。
示例:
>>> rnn = nn.LSTMCell(10, 20) >>> input = torch.randn(6, 3, 10) >>> hx = torch.randn(3, 20) >>> cx = torch.randn(3, 20) >>> output = [] >>> for i in range(6): ... hx, cx = rnn(input[i], (hx, cx)) ... output.append(hx)