MCPcopy Create free account
hub / github.com/dome272/Diffusion-Models-pytorch / forward

Method forward

modules.py:49–55  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

47 )
48
49 def forward(self, x):
50 x = x.view(-1, self.channels, self.size * self.size).swapaxes(1, 2)
51 x_ln = self.ln(x)
52 attention_value, _ = self.mha(x_ln, x_ln, x_ln)
53 attention_value = attention_value + x
54 attention_value = self.ff_self(attention_value) + attention_value
55 return attention_value.swapaxes(2, 1).view(-1, self.channels, self.size, self.size)
56
57
58class DoubleConv(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected