LSTMCell

classtorch.ao.nn.quantized.dynamic.LSTMCell(*args, **kwargs)[源代码]

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)
本页目录