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

Method forward

models/sr3.py:216–226  ·  view source on GitHub ↗
(self, noise_level)

Source from the content-addressed store, hash-verified

214 self.dim = dim
215
216 def forward(self, noise_level):
217 count = self.dim // 2
218 step = (
219 torch.arange(count, dtype=noise_level.dtype, device=noise_level.device)
220 / count
221 )
222 encoding = noise_level.unsqueeze(1) * torch.exp(
223 -math.log(1e4) * step.unsqueeze(0)
224 )
225 encoding = torch.cat([torch.sin(encoding), torch.cos(encoding)], dim=-1)
226 return encoding
227
228
229class FeatureWiseAffine(nn.Module):

Callers

nothing calls this directly

Calls 1

logMethod · 0.80

Tested by

no test coverage detected