MCPcopy Create free account
hub / github.com/Anoise/WTFlib / forward

Method forward

LDPS_Graph/layers/PatchTST_backbone.py:193–205  ·  view source on GitHub ↗
(self, src:Tensor, 
                edge_index: torch.LongTensor,
                edge_weight: torch.FloatTensor,
                key_padding_mask:Optional[Tensor]=None, 
                attn_mask:Optional[Tensor]=None)

Source from the content-addressed store, hash-verified

191 self.res_attention = res_attention
192
193 def forward(self, src:Tensor,
194 edge_index: torch.LongTensor,
195 edge_weight: torch.FloatTensor,
196 key_padding_mask:Optional[Tensor]=None,
197 attn_mask:Optional[Tensor]=None):
198 output = src
199 scores = None
200 if self.res_attention:
201 for mod in self.layers: output, scores = mod(output,edge_index, edge_weight, prev=scores, key_padding_mask=key_padding_mask, attn_mask=attn_mask)
202 return output
203 else:
204 for mod in self.layers: output = mod(output, key_padding_mask=key_padding_mask, attn_mask=attn_mask)
205 return output
206
207
208### Add DG-Conv and SG-Conv

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected