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

Method forward

layers/Embed.py:108–117  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

106 self.month_embed = Embed(month_size, d_model)
107
108 def forward(self, x):
109 x = x.long()
110
111 minute_x = self.minute_embed(x[:, :, 4]) if hasattr(self, 'minute_embed') else 0.
112 hour_x = self.hour_embed(x[:, :, 3])
113 weekday_x = self.weekday_embed(x[:, :, 2])
114 day_x = self.day_embed(x[:, :, 1])
115 month_x = self.month_embed(x[:, :, 0])
116
117 return hour_x + weekday_x + day_x + month_x + minute_x
118
119
120class TimeFeatureEmbedding(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected