torchcell.models.diffusion_decoder.DenoisingBlock

class DenoisingBlock(dim: int, num_heads: int = 8, mlp_ratio: float = 4.0, dropout: float = 0.1, norm: str = 'layer')[source]

Bases: Module

Single denoising block with cross-attention and feedforward.

forward(x: Tensor, context: Tensor, time_emb: Tensor) → Tensor[source]

Apply time embedding, cross-attention, and MLP with residual connections.