MCPcopy Create free account
hub / github.com/NVlabs/RADIO / forward

Method forward

examples/common/model_loader.py:215–227  ·  view source on GitHub ↗
(self, x: torch.Tensor, **kwargs)

Source from the content-addressed store, hash-verified

213 return self.inner
214
215 def forward(self, x: torch.Tensor, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]:
216 x = self.inner.patch_embed(x)
217 if self.inner.pos_embed is not None:
218 x = x + self.inner.pos_embed
219
220 for blk in self.inner.blocks:
221 x = blk(x)
222
223 features = x.flatten(1, 2)
224
225 summary = features.mean(dim=1)
226
227 return summary, features
228
229
230class InternViTWrapper(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected