快捷方式

LSTMCell

class torch.ao.nn.quantized.dynamic.LSTMCell(*args, **kwargs)[source][source]

一个长短期记忆 (LSTM) 单元。

一个动态量化 LSTMCell 模块,输入和输出为浮点 Tensor。权重被量化为 8 比特。我们采用与 torch.nn.LSTMCell 相同的接口,请参阅 https://pytorch.ac.cn/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)

文档

查阅 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得问题解答

查看资源