Skip to content

Commit 5ade300

Browse files
jason-niggerganov
authored andcommitted
ggml: fix ggml_conv_1d_dw bug (ggml/1323)
* ggml: fix ggml_conv_1d_dw bug * Fixed conv1d_dw weight tensor dimension.
1 parent 8b24837 commit 5ade300

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ggml/src/ggml.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,14 +4272,13 @@ struct ggml_tensor * ggml_conv_1d_dw(
42724272
int s0,
42734273
int p0,
42744274
int d0) {
4275-
struct ggml_tensor * new_a = ggml_reshape_4d(ctx, a, a->ne[0], 1, a->ne[1], a->ne[2]);
42764275
struct ggml_tensor * new_b = ggml_reshape_4d(ctx, b, b->ne[0], 1, b->ne[1], b->ne[2]);
42774276

4278-
struct ggml_tensor * im2col = ggml_im2col(ctx, new_a, new_b, s0, 0, p0, 0, d0, 0, false, GGML_TYPE_F16);
4277+
struct ggml_tensor * im2col = ggml_im2col(ctx, a, new_b, s0, 0, p0, 0, d0, 0, false, GGML_TYPE_F16);
42794278

42804279
struct ggml_tensor * result = ggml_mul_mat(ctx, im2col, a);
42814280

4282-
result = ggml_reshape_3d(ctx, result, b->ne[0], b->ne[1], 1);
4281+
result = ggml_reshape_3d(ctx, result, result->ne[0], result->ne[2], 1);
42834282

42844283
return result;
42854284
}

0 commit comments

Comments
 (0)