Skip to content

Commit c229e48

Browse files
author
Joan Martinez
committed
fix: do some cleanup unused vars
1 parent 63a1d7c commit c229e48

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ggml.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12258,7 +12258,11 @@ static void ggml_compute_forward_soft_max_f32(
1225812258
const float slope = h < n_head_log2 ? powf(m0, h + 1) : powf(m1, 2*(h - n_head_log2) + 1);
1225912259

1226012260
for (int i = 0; i < nc; i++) {
12261-
wp[i] = wp[i] - slope*abs(i1%nc - i);
12261+
if (pos == NULL) {
12262+
wp[i] = wp[i] + pos[i];
12263+
} else {
12264+
wp[i] = wp[i] - slope*abs(i1%nc - i);
12265+
}
1226212266
}
1226312267
}
1226412268

@@ -12472,7 +12476,6 @@ static void ggml_compute_forward_alibi_f32(
1247212476

1247312477
for (int64_t i = 0; i < ne0; i++) {
1247412478
for (int64_t j = 0; j < ne1; j++) {
12475-
float * const src = (float *)((char *) src0->data + i*nb0 + j*nb1 + k*nb2);
1247612479
float * pdst = (float *)((char *) dst->data + i*nb0 + j*nb1 + k*nb2);
1247712480
pdst[0] = -1.0f * i * m_k;
1247812481
}

0 commit comments

Comments
 (0)