| 228 | |
| 229 | #[derive(Debug, Clone)] |
| 230 | pub 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 | |
| 252 | impl DoubleStreamBlock { |
| 253 | fn load(vb: VarBuilder, cfg: &Flux2Config, backend: Arc<dyn ComputeBackend>) -> Result<Self> { |
nothing calls this directly
no outgoing calls
no test coverage detected