MCPcopy Create free account
hub / github.com/294coder/Dif-PAN / forward

Method forward

models/sr3_dwt.py:228–238  ·  view source on GitHub ↗
(self, noise_level)

Source from the content-addressed store, hash-verified

226 self.dim = dim
227
228 def forward(self, noise_level):
229 count = self.dim // 2
230 step = (
231 torch.arange(count, dtype=noise_level.dtype, device=noise_level.device)
232 / count
233 )
234 encoding = noise_level.unsqueeze(1) * torch.exp(
235 -math.log(1e4) * step.unsqueeze(0)
236 )
237 encoding = torch.cat([torch.sin(encoding), torch.cos(encoding)], dim=-1)
238 return encoding
239
240
241class FeatureWiseAffine(nn.Module):

Callers

nothing calls this directly

Calls 1

logMethod · 0.80

Tested by

no test coverage detected