MCPcopy Create free account
hub / github.com/FoundationVision/LlamaGen / forward

Method forward

tokenizer/tokenizer_image/vq_model.py:105–124  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

103
104
105 def forward(self, x):
106 h = self.conv_in(x)
107 # downsampling
108 for i_level, block in enumerate(self.conv_blocks):
109 for i_block in range(self.num_res_blocks):
110 h = block.res[i_block](h)
111 if len(block.attn) > 0:
112 h = block.attn[i_block](h)
113 if i_level != self.num_resolutions - 1:
114 h = block.downsample(h)
115
116 # middle
117 for mid_block in self.mid:
118 h = mid_block(h)
119
120 # end
121 h = self.norm_out(h)
122 h = nonlinearity(h)
123 h = self.conv_out(h)
124 return h
125
126
127

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.70

Tested by

no test coverage detected