call method

Tensor call(
  1. Tensor x
)

Implementation

Tensor call(Tensor x) {
  final attnOut = attention(x);
  final h = attentionOutputLn(x + attnOut);
  // Tanh-approx GELU matches exact GELU to < 2e-4 abs on [-6, 6];
  // fine for sentence-embedding retrieval.
  final ffnOut = output(_geluTanh(intermediate(h)));
  return outputLn(h + ffnOut);
}