reset method

void reset()

Clears the conv histories for a new sequence. KV cache rows are written before they are read, so they need no reset.

Implementation

void reset() {
  for (final layer in _layers) {
    if (layer.history >= 0) {
      final n = (config.convKernel - 1) * config.hiddenSize;
      _contents(
        layer.history,
      ).cast<Float>().asTypedList(n).fillRange(0, n, 0);
    }
  }
}