MCPcopy
hub / github.com/hustvl/Vim / forward

Method forward

vim/models_mamba.py:545–552  ·  view source on GitHub ↗
(self, x, return_features=False, inference_params=None, if_random_cls_token_position=False, if_random_token_rank=False)

Source from the content-addressed store, hash-verified

543 raise NotImplementedError
544
545 def forward(self, x, return_features=False, inference_params=None, if_random_cls_token_position=False, if_random_token_rank=False):
546 x = self.forward_features(x, inference_params, if_random_cls_token_position=if_random_cls_token_position, if_random_token_rank=if_random_token_rank)
547 if return_features:
548 return x
549 x = self.head(x)
550 if self.final_pool_type == 'max':
551 x = x.max(dim=1)[0]
552 return x
553
554
555@register_model

Callers

nothing calls this directly

Calls 2

forward_featuresMethod · 0.95
maxMethod · 0.80

Tested by

no test coverage detected