MCPcopy Create free account
hub / github.com/evilsocket/cake / DoubleStreamBlock

Class DoubleStreamBlock

cake-core/src/models/flux/flux2_model.rs:230–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229#[derive(Debug, Clone)]
230pub struct DoubleStreamBlock {
231 // Image attention
232 to_q_weight: Tensor,
233 to_k_weight: Tensor,
234 to_v_weight: Tensor,
235 to_out_weight: Tensor,
236 norm_q: QkNorm,
237 norm_k: QkNorm,
238 // Text attention
239 add_q_proj_weight: Tensor,
240 add_k_proj_weight: Tensor,
241 add_v_proj_weight: Tensor,
242 to_add_out_weight: Tensor,
243 norm_added_q: QkNorm,
244 norm_added_k: QkNorm,
245 // MLPs
246 ff: GatedMLP,
247 ff_context: GatedMLP,
248 num_heads: usize,
249 backend: Arc<dyn ComputeBackend>,
250}
251
252impl DoubleStreamBlock {
253 fn load(vb: VarBuilder, cfg: &Flux2Config, backend: Arc<dyn ComputeBackend>) -> Result<Self> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected