评价此页

GRUCell#

class torch.ao.nn.quantized.dynamic.GRUCell(input_size, hidden_size, bias=True, dtype=torch.qint8)[source]#

一个门控循环单元 (GRU) 单元

一个具有浮点张量作为输入和输出的动态量化 GRUCell 模块。权重被量化为 8 位。我们采用与 torch.nn.GRUCell 相同的接口,请参阅 https://pytorch.ac.cn/docs/stable/nn.html#torch.nn.GRUCell 以获取文档。

示例

>>> rnn = nn.GRUCell(10, 20)
>>> input = torch.randn(6, 3, 10)
>>> hx = torch.randn(3, 20)
>>> output = []
>>> for i in range(6):
...     hx = rnn(input[i], hx)
...     output.append(hx)