logitsOf method
Applies the final norm and the tied LM head to one residual vector, leaving the result in logits.
Implementation
Future<Float32List> logitsOf(Float32List residual) async {
_checkOpen();
if (_gpu != null) {
final result = _gpu.logitsOf(residual);
_hasHiddenState = true;
return result;
}
rmsNorm(
residual,
_finalNorm,
_normed,
0,
0,
config.hiddenSize,
config.normEps,
);
await _executor!.lmHead(_normed, logits);
_hasHiddenState = true;
return logits;
}