fix: patch 1x1 conv weights at runtime (#986)

This commit is contained in:
stduhpf 2025-11-19 16:27:23 +01:00 committed by GitHub
parent a14e2b321d
commit aa2b8e0ca5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -997,6 +997,9 @@ __STATIC_INLINE__ struct ggml_tensor* ggml_ext_conv_2d(struct ggml_context* ctx,
if (scale != 1.f) {
x = ggml_scale(ctx, x, scale);
}
if (w->ne[2] != x->ne[2] && ggml_n_dims(w) == 2) {
w = ggml_reshape_4d(ctx, w, 1, 1, w->ne[0], w->ne[1]);
}
if (direct) {
x = ggml_conv_2d_direct(ctx, w, x, s0, s1, p0, p1, d0, d1);
} else {