← Back to C-Kernel-Engine Docs Doxygen Source Documentation
 
Loading...
Searching...
No Matches
logit_kernels.c
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#include "ckernel_engine.h"
4
5#include <stddef.h>
6
7void final_logit_scale_f32(float *logits,
8 int tokens,
9 int vocab_size,
10 float scale)
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}
void final_logit_scale_f32(float *logits, int tokens, int vocab_size, float scale)
int vocab_size
Definition true_bpe.h:193