| 170 | return list(hidden) |
| 171 | |
| 172 | def forward(self, inputs, last_pred, hidden, p): |
| 173 | h_in = self.emb(inputs) |
| 174 | pos_enc = self.positional_encoder(p).to(inputs.device).detach() |
| 175 | h_in = h_in + pos_enc |
| 176 | for i in range(self.n_layers): |
| 177 | # print(h_in.shape) |
| 178 | hidden[i] = self.gru[i](h_in, hidden[i]) |
| 179 | h_in = hidden[i] |
| 180 | pose_pred = self.output(h_in) |
| 181 | # pose_pred = self.output(h_in) + last_pred.detach() |
| 182 | # contact = self.contact_net(pose_pred) |
| 183 | # return torch.cat([pose_pred, contact], dim=-1), hidden |
| 184 | return pose_pred, hidden |
| 185 | |
| 186 | |
| 187 | class TextDecoder(nn.Module): |