MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / forward_features

Method forward_features

modules/VIPTRv1.py:956–969  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

954 pass
955
956 def forward_features(self, x):
957 x = self.patch_embed(x)
958 _, H, W, _ = x.shape
959 for layer in self.layers:
960 x = layer(x, (H, W))
961 H = x.shape[1]
962 # print(x.shape) # nhwc
963 x = self.norm(x)
964 x = x.permute(0, 2, 3, 1).contiguous() # nwch
965 x = self.pooling(x)
966 x = x.squeeze(3) # .reshape(b, W, -1)
967 x = self.mlp_head(x)
968
969 return x
970
971 def forward(self, x):
972 x = self.forward_features(x)

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected