MCPcopy Create free account
hub / github.com/dek924/PerX2CT / forward

Method forward

taming/modules/diffusionmodules/model.py:513–544  ·  view source on GitHub ↗
(self, z)

Source from the content-addressed store, hash-verified

511 padding=1)
512
513 def forward(self, z):
514 #assert z.shape[1:] == self.z_shape[1:]
515 self.last_z_shape = z.shape
516
517 # timestep embedding
518 temb = None
519
520 # z to block_in
521 h = self.conv_in(z)
522
523 # middle
524 h = self.mid.block_1(h, temb)
525 h = self.mid.attn_1(h)
526 h = self.mid.block_2(h, temb)
527
528 # upsampling
529 for i_level in reversed(range(self.num_resolutions)):
530 for i_block in range(self.num_res_blocks+1):
531 h = self.up[i_level].block[i_block](h, temb)
532 if len(self.up[i_level].attn) > 0:
533 h = self.up[i_level].attn[i_block](h)
534 if i_level != 0:
535 h = self.up[i_level].upsample(h)
536
537 # end
538 if self.give_pre_end:
539 return h
540
541 h = self.norm_out(h)
542 h = nonlinearity(h)
543 h = self.conv_out(h)
544 return h
545
546
547class VUNet(nn.Module):

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.70

Tested by

no test coverage detected