Skip to content

Commit 37fb6d3

Browse files
authored
Update ggml_extend.hpp
1 parent 9e01433 commit 37fb6d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ggml_extend.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,13 +1309,15 @@ class Linear : public UnaryBlock {
13091309
out = ggml_add(ctx, act, b);
13101310
}
13111311

1312+
auto ne = im->ne[0];
1313+
13121314
auto im = ggml_mul_mat(ctx, x, w);
1313-
auto empty = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, im.ne[0]);
1315+
auto empty = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, ne);
13141316
auto eyev = ggml_set_f32(eye, 1.0f);
13151317
auto eye = ggml_diag(ctx, eyev);
13161318
auto imm = ggml_mul_mat(ctx, im, eye);
13171319
auto ims = ggml_sum_rows(ctx, imm);
1318-
auto imv = ggml_reshape_1d(ctx, ims, im.ne[0]);
1320+
auto imv = ggml_reshape_1d(ctx, ims, ne);
13191321

13201322
//
13211323
print_ggml_tensor(x, true, "imatrix x");

0 commit comments

Comments
 (0)