Update modeling_super_linear.py
Browse files212 unmodified lines213214215216217218219220221222223224225226227228229230231232233234235236237238212 unmodified linesdef forward(self, x):# x: [Batch, Input length,Channel]x_shape = x.shapeprint(x.shape)if len(x_shape) == 2:x = x.unsqueeze(-1)B,L,V = x.shapeif L < self.seq_len and self.zero_shot_Linear is None:print(F"New Lookback :{L}")self.transform_model(L)if L < self.seq_len:x = x.clone()x = self.revin_layer(x, 'norm')x = F.linear(x, self.zero_shot_Linear)x = self.revin_layer(x, 'denorm')else:x = x.clone()x = self.revin_layer(x, 'norm')x = self.Linear(x.permute(0,2,1)).permute(0,2,1).clone()x = self.revin_layer(x, 'denorm')if len(x_shape) == 2:x = x.squeeze(-1)212 unmodified lines213214215216217218219220221222223224225226227228229230231232233234235212 unmodified linesdef forward(self, x):# x: [Batch, Input length,Channel]x_shape = x.shapeif x.shape[1] < self.seq_len:if self.zero_shot_Linear is None:self.transform_model(L)x = x.clone()x = self.revin_layer(x, 'norm')x = F.linear(x, self.zero_shot_Linear)x = self.revin_layer(x, 'denorm')return xif len(x_shape) == 2:x = x.unsqueeze(-1)x = x.clone()x = self.revin_layer(x, 'norm')x = self.Linear(x.permute(0,2,1)).permute(0,2,1).clone()x = self.revin_layer(x, 'denorm')if len(x_shape) == 2:x = x.squeeze(-1)
modeling_super_linear.py+12-15