Source code for neural_de.transformations.diffusion.unet.timestep_block

from abc import abstractmethod

from torch import nn


[docs] class TimestepBlock(nn.Module): """ Any module where forward() takes timestep embeddings as a second argument. """
[docs] @abstractmethod def forward(self, x, emb): """ Apply the module to `x` given `emb` timestep embeddings. """