call method

Tensor call(
  1. Tensor x
)

Implementation

Tensor call(Tensor x) {
  if (_crossK == null) {
    throw StateError('WhisperDecoderBlock: call primeCrossAttn(xa) first.');
  }
  final normed = attnLn(x);
  final attn = _causalSelfAttn(normed);
  var h = x + attn;

  final crossNormed = crossAttnLn(h);
  final cross = _crossAttn(crossNormed);
  h = h + cross;

  final mlpNormed = mlpLn(h);
  var mlp = mlp0(mlpNormed);
  mlp = WhisperEncoderBlock.geluTanh(mlp);
  mlp = mlp2(mlp);
  return h + mlp;
}