MCPcopy Create free account
hub / github.com/MotrixLab/insactor / forward

Method forward

diffplanner/models/rnns/t2m_bigru.py:90–102  ·  view source on GitHub ↗
(self, motion, motion_length, motion_mask)

Source from the content-addressed store, hash-verified

88 self.motion_encoder.load_state_dict(checkpoint['motion_encoder'])
89
90 def forward(self, motion, motion_length, motion_mask):
91 motion = motion.detach().float()
92 sort_idx = np.argsort(motion_length.data.tolist())[::-1].copy()
93 rank_idx = np.empty_like(sort_idx)
94 rank_idx[sort_idx] = np.arange(len(motion_length))
95 motion = motion[sort_idx]
96 motion_length = motion_length[sort_idx]
97
98 movements = self.movement_encoder(motion[..., :-4]).detach()
99 m_lens = motion_length // 4
100 motion_embedding = self.motion_encoder(movements, m_lens)
101 motion_embedding_ordered = motion_embedding[rank_idx]
102 return motion_embedding_ordered
103
104
105@SUBMODULES.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected