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

Method forward

semantic_sam/backbone/focal_dw.py:749–764  ·  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

747 }
748
749 def forward(self, x):
750 """
751 Args:
752 x: Tensor of shape (N,C,H,W). H, W must be a multiple of ``self.size_divisibility``.
753 Returns:
754 dict[str->Tensor]: names and the corresponding features
755 """
756 assert (
757 x.dim() == 4
758 ), f"SwinTransformer takes an input of shape (N, C, H, W). Got {x.shape} instead!"
759 outputs = {}
760 y = super().forward(x)
761 for k in y.keys():
762 if k in self._out_features:
763 outputs[k] = y[k]
764 return outputs
765
766 def output_shape(self):
767 return {

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected