fix: remove duplicate argmax_v — use NaN-safe version from sample.h
This commit is contained in:
@@ -3481,11 +3481,6 @@ static void mtp_absorb(Model *m, const int *next_ids, const float *x, int S, int
|
|||||||
free(hx); free(cat); free(e); free(hn); free(hf); free(nrm); free(tmp);
|
free(hx); free(cat); free(e); free(hn); free(hf); free(nrm); free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int argmax_v(const float *lo, int V){
|
|
||||||
int b=-1; float bv=-INFINITY;
|
|
||||||
for(int i=0;i<V;i++){ float x=lo[i]; if(x==x && x>bv){ bv=x; b=i; } }
|
|
||||||
return b<0?0:b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void repin_pass_limit(Model *m,int limit);
|
static void repin_pass_limit(Model *m,int limit);
|
||||||
static void repin_pass(Model *m){ repin_pass_limit(m,16); }
|
static void repin_pass(Model *m){ repin_pass_limit(m,16); }
|
||||||
|
|||||||
+3
-3
@@ -17,9 +17,9 @@ static inline double rndu(void){
|
|||||||
|
|
||||||
/* ---- argmax over a float vector ----------------------------------------- */
|
/* ---- argmax over a float vector ----------------------------------------- */
|
||||||
static inline int argmax_v(const float *lo, int V){
|
static inline int argmax_v(const float *lo, int V){
|
||||||
int b = 0; float bv = lo[0];
|
int b=-1; float bv=-INFINITY;
|
||||||
for (int i = 1; i < V; i++) if (lo[i] > bv) { bv = lo[i]; b = i; }
|
for(int i=0;i<V;i++){ float x=lo[i]; if(x==x && x>bv){ bv=x; b=i; } }
|
||||||
return b;
|
return b<0?0:b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- distribution buffers (reused, single-threaded decode) --------------- */
|
/* ---- distribution buffers (reused, single-threaded decode) --------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user