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

Method forward

semantic_sam/body/transformer_blocks.py:85–102  ·  view source on GitHub ↗
(
        self,
        src,
        mask: Optional[Tensor] = None,
        src_key_padding_mask: Optional[Tensor] = None,
        pos: Optional[Tensor] = None,
    )

Source from the content-addressed store, hash-verified

83 self.norm = norm
84
85 def forward(
86 self,
87 src,
88 mask: Optional[Tensor] = None,
89 src_key_padding_mask: Optional[Tensor] = None,
90 pos: Optional[Tensor] = None,
91 ):
92 output = src
93
94 for layer in self.layers:
95 output = layer(
96 output, src_mask=mask, src_key_padding_mask=src_key_padding_mask, pos=pos
97 )
98
99 if self.norm is not None:
100 output = self.norm(output)
101
102 return output
103
104
105class TransformerDecoder(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected