Spaces:
Running
Running
ggml: fix ggml_conv_1d_dw bug (ggml/1323)
Browse files* ggml: fix ggml_conv_1d_dw bug
* Fixed conv1d_dw weight tensor dimension.
- ggml/src/ggml.c +2 -3
ggml/src/ggml.c
CHANGED
|
@@ -4272,14 +4272,13 @@ struct ggml_tensor * ggml_conv_1d_dw(
|
|
| 4272 |
int s0,
|
| 4273 |
int p0,
|
| 4274 |
int d0) {
|
| 4275 |
-
struct ggml_tensor * new_a = ggml_reshape_4d(ctx, a, a->ne[0], 1, a->ne[1], a->ne[2]);
|
| 4276 |
struct ggml_tensor * new_b = ggml_reshape_4d(ctx, b, b->ne[0], 1, b->ne[1], b->ne[2]);
|
| 4277 |
|
| 4278 |
-
struct ggml_tensor * im2col = ggml_im2col(ctx,
|
| 4279 |
|
| 4280 |
struct ggml_tensor * result = ggml_mul_mat(ctx, im2col, a);
|
| 4281 |
|
| 4282 |
-
result = ggml_reshape_3d(ctx, result,
|
| 4283 |
|
| 4284 |
return result;
|
| 4285 |
}
|
|
|
|
| 4272 |
int s0,
|
| 4273 |
int p0,
|
| 4274 |
int d0) {
|
|
|
|
| 4275 |
struct ggml_tensor * new_b = ggml_reshape_4d(ctx, b, b->ne[0], 1, b->ne[1], b->ne[2]);
|
| 4276 |
|
| 4277 |
+
struct ggml_tensor * im2col = ggml_im2col(ctx, a, new_b, s0, 0, p0, 0, d0, 0, false, GGML_TYPE_F16);
|
| 4278 |
|
| 4279 |
struct ggml_tensor * result = ggml_mul_mat(ctx, im2col, a);
|
| 4280 |
|
| 4281 |
+
result = ggml_reshape_3d(ctx, result, result->ne[0], result->ne[2], 1);
|
| 4282 |
|
| 4283 |
return result;
|
| 4284 |
}
|