MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / forward

Method forward

layers/Autoformer_EncDec.py:126–137  ·  view source on GitHub ↗
(self, x, attn_mask=None)

Source from the content-addressed store, hash-verified

124 self.activation = F.relu if activation == "relu" else F.gelu
125
126 def forward(self, x, attn_mask=None):
127 new_x, attn = self.attention(
128 x, x, x,
129 attn_mask=attn_mask
130 )
131 x = x + self.dropout(new_x)
132 x, _ = self.decomp1(x)
133 y = x
134 y = self.dropout(self.activation(self.conv1(y.transpose(-1, 1))))
135 y = self.dropout(self.conv2(y).transpose(-1, 1))
136 res, _ = self.decomp2(x + y)
137 return res, attn
138
139
140class Encoder(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected