RNNCell
-
class torch.ao.nn.quantized.dynamic.RNNCell(input_size, hidden_size, bias=True, nonlinearity='tanh', dtype=torch.qint8)[исходный код] -
Ячейка RNN Элмана с нелинейностью tanh или ReLU. Модуль динамически квантованной RNNCell, принимающий на вход и возвращающий тензоры с плавающей точкой. Веса квантованы до 8 бит. Мы используем тот же интерфейс, что и
torch.nn.RNNCell; документацию см. по адресу https://pytorch.org/docs/stable/nn.html#torch.nn.RNNCell.Примеры:
>>> rnn = nn.RNNCell(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)
© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.ao.nn.quantized.dynamic.RNNCell.html