← Back to C-Kernel-Engine Docs Doxygen Source Documentation
 
Loading...
Searching...
No Matches
logit_kernels.c File Reference
#include "ckernel_engine.h"
#include <stddef.h>

Go to the source code of this file.

Functions

void final_logit_scale_f32 (float *logits, int tokens, int vocab_size, float scale)
 

Function Documentation

◆ final_logit_scale_f32()

void final_logit_scale_f32 ( float *  logits,
int  tokens,
int  vocab_size,
float  scale 
)

Definition at line 7 of file logit_kernels.c.

11{
12 if (!logits || tokens <= 0 || vocab_size <= 0) {
13 return;
14 }
15
16 const size_t total = (size_t) tokens * (size_t) vocab_size;
17 for (size_t i = 0; i < total; ++i) {
18 logits[i] *= scale;
19 }
20}
int vocab_size
Definition true_bpe.h:193

References vocab_size.