MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / forward

Method forward

sat/sgm/modules/diffusionmodules/model.py:519–544  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

517 )
518
519 def forward(self, x):
520 # timestep embedding
521 temb = None
522
523 # downsampling
524 hs = [self.conv_in(x)]
525 for i_level in range(self.num_resolutions):
526 for i_block in range(self.num_res_blocks):
527 h = self.down[i_level].block[i_block](hs[-1], temb)
528 if len(self.down[i_level].attn) > 0:
529 h = self.down[i_level].attn[i_block](h)
530 hs.append(h)
531 if i_level != self.num_resolutions - 1:
532 hs.append(self.down[i_level].downsample(hs[-1]))
533
534 # middle
535 h = hs[-1]
536 h = self.mid.block_1(h, temb)
537 h = self.mid.attn_1(h)
538 h = self.mid.block_2(h, temb)
539
540 # end
541 h = self.norm_out(h)
542 h = nonlinearity(h)
543 h = self.conv_out(h)
544 return h
545
546
547class Decoder(nn.Module):

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
nonlinearityFunction · 0.70

Tested by

no test coverage detected