GRUCell
- 类torch.ao.nn.quantized.dynamic.GRUCell(input_size, hidden_size, bias=True, dtype=torch.qint8)[源代码]
-
门控循环单元(GRU)
这是一个动态量化GRUCell模块,具有浮点张量输入和输出。权重被量化为8位。我们采用了与torch.nn.GRUCell相同的接口,请参见https://pytorch.org/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)