home diffusion ddpm
View code on Github
10import torch.utils.data
සිතියම්හැඩයට විශේෂාංග කිරීමට t සහ නැවත සකස් කිරීම සඳහා ගැටුම් එක්රැස් කරන්න
13def gather(consts: torch.Tensor, t: torch.Tensor):
15 c = consts.gather(-1, t) 16 return c.reshape(-1, 1, 1, 1)