@@ -101,8 +101,8 @@ struct TimestepEmbedder : public GGMLBlock {
101101 TimestepEmbedder (int64_t hidden_size,
102102 int64_t frequency_embedding_size = 256 )
103103 : frequency_embedding_size(frequency_embedding_size) {
104- blocks[" mlp.0" ] = std::shared_ptr<GGMLBlock>(new Linear (frequency_embedding_size, hidden_size));
105- blocks[" mlp.2" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, hidden_size));
104+ blocks[" mlp.0" ] = std::shared_ptr<GGMLBlock>(new Linear (frequency_embedding_size, hidden_size, true , true ));
105+ blocks[" mlp.2" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, hidden_size, true , true ));
106106 }
107107
108108 struct ggml_tensor * forward (struct ggml_context * ctx, struct ggml_tensor * t) {
@@ -125,8 +125,8 @@ struct VectorEmbedder : public GGMLBlock {
125125public:
126126 VectorEmbedder (int64_t input_dim,
127127 int64_t hidden_size) {
128- blocks[" mlp.0" ] = std::shared_ptr<GGMLBlock>(new Linear (input_dim, hidden_size));
129- blocks[" mlp.2" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, hidden_size));
128+ blocks[" mlp.0" ] = std::shared_ptr<GGMLBlock>(new Linear (input_dim, hidden_size, true , true ));
129+ blocks[" mlp.2" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, hidden_size, true , true ));
130130 }
131131
132132 struct ggml_tensor * forward (struct ggml_context * ctx, struct ggml_tensor * x) {
@@ -423,7 +423,7 @@ struct FinalLayer : public GGMLBlock {
423423 int64_t out_channels) {
424424 // total_out_channels is always None
425425 blocks[" norm_final" ] = std::shared_ptr<GGMLBlock>(new LayerNorm (hidden_size, 1e-06f , false ));
426- blocks[" linear" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, patch_size * patch_size * out_channels));
426+ blocks[" linear" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, patch_size * patch_size * out_channels, true , true ));
427427 blocks[" adaLN_modulation.1" ] = std::shared_ptr<GGMLBlock>(new Linear (hidden_size, 2 * hidden_size));
428428 }
429429
@@ -510,7 +510,7 @@ struct MMDiT : public GGMLBlock {
510510 blocks[" y_embedder" ] = std::shared_ptr<GGMLBlock>(new VectorEmbedder (adm_in_channels, hidden_size));
511511 }
512512
513- blocks[" context_embedder" ] = std::shared_ptr<GGMLBlock>(new Linear (4096 , 1536 ));
513+ blocks[" context_embedder" ] = std::shared_ptr<GGMLBlock>(new Linear (4096 , 1536 , true , true ));
514514
515515 for (int i = 0 ; i < depth; i++) {
516516 blocks[" joint_blocks." + std::to_string (i)] = std::shared_ptr<GGMLBlock>(new JointBlock (hidden_size,
0 commit comments