Skip to content
class

RNNCell

extendsRNNCell]
RNNCell(shell: nn.Module)

int8-weight Elman cell built from a float lucid.nn.RNNCell.

Stored and run like LSTMCell, with a float nn.RNNCell shell, so its nonlinearity (tanh or relu) is kept. Built by lucid.quantization.quantize_dynamic.

Parameters

The float cell whose configuration and arithmetic are reused.

Used by 1

Class methods

1
cls

from_float

→Selffrom _DynamicRecurrent
from_float(mod: nn.Module, dtype: QDtype = qint8)

Quantize a float recurrent module's weights to int8 (no calibration).

mod must be the float type the layer runs — an nn.LSTM for LSTM, an nn.GRUCell for GRUCell.

Instance methods

2
fn

extra_repr

→strfrom _DynamicRecurrent
extra_repr()

Override to add extra repr info (e.g. Linear shows in_features, etc.).

fn

forward

→Tensor
forward(input: Tensor, hx: Tensor | None = None)

Inject dequantized weights into the shell and run one step.