MCPcopy Create free account
hub / github.com/lingeringlight/START / forward

Method forward

models_mamba.py:56–64  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

54 self.norm = norm_layer(embed_dim) if norm_layer else nn.Identity()
55
56 def forward(self, x):
57 B, C, H, W = x.shape
58 assert H == self.img_size[0] and W == self.img_size[1], \
59 f"Input image size ({H}*{W}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})."
60 x = self.proj(x)
61 if self.flatten:
62 x = x.flatten(2).transpose(1, 2) # BCHW -> BNC
63 x = self.norm(x)
64 return x
65
66
67class Block(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected