home diffusion ddpm
View code on Github
10import torch.utils.data
Gather consts for t and reshape to feature map shape
13def gather(consts: torch.Tensor, t: torch.Tensor):
15 c = consts.gather(-1, t) 16 return c.reshape(-1, 1, 1, 1)