MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / forward

Method forward

semantic_sam/backbone/focal.py:652–667  ·  view source on GitHub ↗

Args: x: Tensor of shape (N,C,H,W). H, W must be a multiple of ``self.size_divisibility``. Returns: dict[str->Tensor]: names and the corresponding features

(self, x)

Source from the content-addressed store, hash-verified

650 }
651
652 def forward(self, x):
653 """
654 Args:
655 x: Tensor of shape (N,C,H,W). H, W must be a multiple of ``self.size_divisibility``.
656 Returns:
657 dict[str->Tensor]: names and the corresponding features
658 """
659 assert (
660 x.dim() == 4
661 ), f"SwinTransformer takes an input of shape (N, C, H, W). Got {x.shape} instead!"
662 outputs = {}
663 y = super().forward(x)
664 for k in y.keys():
665 if k in self._out_features:
666 outputs[k] = y[k]
667 return outputs
668
669 def output_shape(self):
670 return {

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected