| 4407 | // ggml_conv_1d |
| 4408 | |
| 4409 | struct ggml_tensor * ggml_conv_1d( |
| 4410 | struct ggml_context * ctx, |
| 4411 | struct ggml_tensor * a, |
| 4412 | struct ggml_tensor * b, |
| 4413 | int s0, |
| 4414 | int p0, |
| 4415 | int d0) { |
| 4416 | struct ggml_tensor * im2col = ggml_im2col(ctx, a, b, s0, 0, p0, 0, d0, 0, false, GGML_TYPE_F16); // [N, OL, IC * K] |
| 4417 | |
| 4418 | struct ggml_tensor * result = |
| 4419 | ggml_mul_mat(ctx, |
| 4420 | ggml_reshape_2d(ctx, im2col, im2col->ne[0], (im2col->ne[2] * im2col->ne[1])), // [N, OL, IC * K] => [N*OL, IC * K] |
| 4421 | ggml_reshape_2d(ctx, a, (a->ne[0] * a->ne[1]), a->ne[2])); // [OC,IC, K] => [OC, IC * K] |
| 4422 | |
| 4423 | result = ggml_reshape_3d(ctx, result, im2col->ne[1], a->ne[2], im2col->ne[2]); // [N, OC, OL] |
| 4424 | |
| 4425 | return result; |
| 4426 | } |
| 4427 | |
| 4428 | // ggml_conv_1d_ph |
| 4429 |
no test coverage detected