Skip to content

Commit 8914625

Browse files
authored
Update vae.hpp _inplace
1 parent c4c05d9 commit 8914625

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vae.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ResnetBlock : public UnaryBlock {
5656
x = nin_shortcut->forward(ctx, x); // [N, out_channels, h, w]
5757
}
5858

59-
h = ggml_add(ctx, h, x);
59+
h = ggml_add_inplace(ctx, h, x);
6060
return h; // [N, out_channels, h, w]
6161
}
6262
};
@@ -109,7 +109,7 @@ class AttnBlock : public UnaryBlock {
109109

110110
h_ = proj_out->forward(ctx, h_); // [N, in_channels, h, w]
111111

112-
h_ = ggml_add(ctx, h_, x);
112+
h_ = ggml_add_inplace(ctx, h_, x);
113113
return h_;
114114
}
115115
};
@@ -206,7 +206,7 @@ class VideoResnetBlock : public ResnetBlock {
206206
x = time_stack->forward(ctx, x); // b t c (h w)
207207

208208
float alpha = get_alpha();
209-
x = ggml_add(ctx,
209+
x = ggml_add_inplace(ctx,
210210
ggml_scale(ctx, x, alpha),
211211
ggml_scale(ctx, x_mix, 1.0f - alpha));
212212

0 commit comments

Comments
 (0)