MCPcopy Create free account
hub / github.com/TPCD/DCCL / forward

Method forward

model/vision_transformer.py:310–319  ·  view source on GitHub ↗
(self, x, return_features=False)

Source from the content-addressed store, hash-verified

308 self.fc = nn.Linear(768, num_classes)
309
310 def forward(self, x, return_features=False):
311
312 features = self.base_vit(x)
313 features = torch.nn.functional.normalize(features, dim=-1)
314 logits = self.fc(features)
315
316 if return_features:
317 return logits, features
318 else:
319 return logits
320
321 @torch.no_grad()
322 def normalize_prototypes(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected