MCPcopy Create free account
hub / github.com/Modulus-Labs/RockyBot / forward

Method forward

pytorch-model/models.py:164–176  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

162 self.output_projection = nn.Linear(in_features=self.c_dim, out_features=self.out_dim)
163
164 def forward(self, x):
165 # --- x \in (N, L, H_dim) ---
166 # --- outputs \in (L, N, H_dim) ---
167 x = torch.transpose(x, 0, 1)
168 outputs, (h_n, c_n) = self.lstm(x)
169
170 # --- Only classify the last layer ---
171 out = self.output_projection(outputs)
172
173 # --- out: (L, N, output_dim) ---
174 # --- First transpose: (N, L, output_dim)
175 # --- second transpose (N, output_dim, L) ---
176 return torch.transpose(torch.transpose(out, 0, 1), 1, 2)
177
178
179# --- For argparse ---

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected