Skip to content
class

GRU

extendsGRU]
GRU(shell: nn.Module)

int8-weight GRU built from a float lucid.nn.GRU.

The GRU counterpart of LSTM: each layer's (and direction's) weight_ih / weight_hh is stored int8 per-row symmetric under the flat name a float GRU's state_dict uses (weight_ih_l0_int8, weight_ih_l0_scale), the biases stay float, and a float nn.GRU shell outside the module registry runs the recurrence on the dequantized weights. Built by lucid.quantization.quantize_dynamic.

Parameters

The float GRU whose configuration and recurrence 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.).