MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / forward

Method forward

selfpatch_vision_transformer.py:256–259  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

254 self.proj = nn.Conv2d(in_chans, embed_dim, kernel_size=patch_size, stride=patch_size)
255
256 def forward(self, x):
257 B, C, H, W = x.shape
258 x = self.proj(x).flatten(2).transpose(1, 2)
259 return x
260
261
262class VisionTransformer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected