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

Method forward

LDPS_Graph/models/PatchTST.py:81–98  ·  view source on GitHub ↗
(self, x, edge_index, edge_attr)

Source from the content-addressed store, hash-verified

79
80
81 def forward(self, x, edge_index, edge_attr): # x: [Batch, Input length, Channel]
82 if self.decomposition:
83 res_init, trend_init = self.decomp_module(x)
84 res_init, trend_init = res_init.permute(0,2,1), trend_init.permute(0,2,1) # x: [Batch, Channel, Input length]
85 res = self.model_res(res_init)
86 trend = self.model_trend(trend_init)
87 x = res + trend
88 x = x.permute(0,2,1) # x: [Batch, Input length, Channel]
89 else:
90 #print(x.shape, edge_index.shape, edge_attr.shape)
91 # x: [1, Channel, Input length]
92 if len(x.shape)<3:
93 x = x.unsqueeze(0)
94 x = self.model(x, edge_index, edge_attr)
95 # x: [Batch, Input length, Channel]
96 # if len(x.shape)==3:
97 # x = x.squeeze(0)
98 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected