mixer method

Float32List mixer(
  1. int layer,
  2. Float32List a,
  3. int n,
  4. int position,
)

This shard's partial of layer layer's mixer for the n normalized inputs a (n, H) at positions position, position + 1, ... Returns a view of n, H valid until the next call.

Implementation

Float32List mixer(int layer, Float32List a, int n, int position) {
  final conv = _conv[layer];
  if (conv != null) {
    _convMixer(conv, a, n);
  } else {
    _attentionMixer(_attention[layer]!, a, n, position);
  }
  return Float32List.sublistView(_out, 0, n * config.hiddenSize);
}