Skip to content

Commit 6fce2d5

Browse files
tdakhranCISC
andauthored
Remove extra ggml_conv and put others into the right place
Co-authored-by: Sigbjørn Skjæret <[email protected]>
1 parent b47e68e commit 6fce2d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/mtmd/clip.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,14 @@ struct clip_graph {
569569
}
570570

571571
// unshuffle h
572-
cur = ggml_reshape_3d(ctx0, ggml_cont(ctx0, cur), n_embd * scale_factor, width / scale_factor, height);
573-
cur = ggml_permute(ctx0, cur, 0, 2, 1, 3);
572+
cur = ggml_reshape_3d(ctx0, cur, n_embd * scale_factor, width / scale_factor, height);
573+
cur = ggml_cont(ctx0, ggml_permute(ctx0, cur, 0, 2, 1, 3));
574574

575575
// unshuffle w
576-
cur = ggml_reshape_3d(ctx0, ggml_cont(ctx0, cur), n_embd * scale_factor * scale_factor, height / scale_factor, width / scale_factor);
577-
cur = ggml_permute(ctx0, cur, 0, 2, 1, 3);
576+
cur = ggml_reshape_3d(ctx0, cur, n_embd * scale_factor * scale_factor, height / scale_factor, width / scale_factor);
577+
cur = ggml_cont(ctx0, ggml_permute(ctx0, cur, 0, 2, 1, 3));
578578

579-
cur = ggml_reshape_2d(ctx0, ggml_cont(ctx0, cur), cur->ne[0], cur->ne[1] * cur->ne[2]);
579+
cur = ggml_reshape_2d(ctx0, cur, cur->ne[0], cur->ne[1] * cur->ne[2]);
580580

581581
// projection
582582
cur = ggml_norm(ctx0, cur, 1e-5); // default nn.LayerNorm

0 commit comments

Comments
 (0)