MCPcopy Create free account
hub / github.com/Francis-Rings/StableAnimator / forward

Method forward

animation/helper/backbones/vit.py:127–132  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

125 kernel_size=patch_size, stride=patch_size)
126
127 def forward(self, x):
128 batch_size, channels, height, width = x.shape
129 assert height == self.img_size[0] and width == self.img_size[1], \
130 f"Input image size ({height}*{width}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})."
131 x = self.proj(x).flatten(2).transpose(1, 2)
132 return x
133
134
135class VisionTransformer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected