MCPcopy Create free account
hub / github.com/kyegomez/BitNet / forward

Method forward

bitnet/one_bit_vision_transformers.py:157–167  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

155 self.linear_head = nn.LayerNorm(dim)
156
157 def forward(self, img):
158 device = img.device
159
160 x = self.to_patch_embedding(img)
161 x += self.pos_embedding.to(device, dtype=x.dtype)
162
163 x = self.transformer(x)
164 x = x.mean(dim=1)
165
166 x = self.to_latent(x)
167 return self.linear_head(x)
168
169
170# import torch

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected