MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / nearest_int

Function nearest_int

smallthinker/tools/perplexity/perplexity.cpp:70–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static inline int nearest_int(float fval) {
71 //assert(fval <= 4194303.f);
72 float val = fval + 12582912.f;
73 int i; memcpy(&i, &val, sizeof(int));
74 return (i & 0x007fffff) - 0x00400000;
75}
76
77static double log_softmax(int n_vocab, const float * logits, uint16_t * log_prob, int tok) {
78 float max_logit = logits[0];

Callers 1

log_softmaxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected