| 5264 | } |
| 5265 | |
| 5266 | GGML_API struct ggml_tensor * ggml_conv_1d( |
| 5267 | struct ggml_context * ctx, |
| 5268 | struct ggml_tensor * a, |
| 5269 | struct ggml_tensor * b, |
| 5270 | int s0, |
| 5271 | int p0, |
| 5272 | int d0) { |
| 5273 | struct ggml_tensor * im2col = ggml_im2col(ctx, a, b, s0, 0, p0, 0, d0, 0, false); // [N, OL, IC * K] |
| 5274 | |
| 5275 | struct ggml_tensor * result = |
| 5276 | ggml_mul_mat(ctx, |
| 5277 | ggml_reshape_2d(ctx, im2col, im2col->ne[0], (im2col->ne[2] * im2col->ne[1])), // [N, OL, IC * K] => [N*OL, IC * K] |
| 5278 | ggml_reshape_2d(ctx, a, (a->ne[0] * a->ne[1]), a->ne[2])); // [OC,IC, K] => [OC, IC * K] |
| 5279 | |
| 5280 | result = ggml_reshape_3d(ctx, result, im2col->ne[1], a->ne[2], im2col->ne[2]); // [N, OC, OL] |
| 5281 | |
| 5282 | return result; |
| 5283 | } |
| 5284 | |
| 5285 | // ggml_conv_1d_ph |
| 5286 |
no test coverage detected