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

Method forward

models/unet_model_google.py:134–142  ·  view source on GitHub ↗
(self, x, time_emb, guidance=None)

Source from the content-addressed store, hash-verified

132 self.atten_guide = AttentiveGuide(dim_out) if attn_guide else nn.Identity()
133
134 def forward(self, x, time_emb, guidance=None):
135 h = self.block1(x)
136 if exists(self.mlp):
137 h += self.mlp(time_emb)[:, :, None, None]
138 if exists(guidance):
139 # guidance should have the same shape as h
140 h = self.atten_guide(h, guidance)
141 h = self.block2(h)
142 return h + self.res_conv(x)
143
144
145class SelfAttention(nn.Module):

Callers

nothing calls this directly

Calls 1

existsFunction · 0.70

Tested by

no test coverage detected