MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / get_padding_mask

Function get_padding_mask

text2motion/datasets/evaluator_models.py:54–59  ·  view source on GitHub ↗
(batch_size, seq_len, cap_lens)

Source from the content-addressed store, hash-verified

52
53
54def get_padding_mask(batch_size, seq_len, cap_lens):
55 cap_lens = cap_lens.data.tolist()
56 mask_2d = torch.ones((batch_size, seq_len, seq_len), dtype=torch.float32)
57 for i, cap_len in enumerate(cap_lens):
58 mask_2d[i, :, :cap_len] = 0
59 return mask_2d.bool(), 1 - mask_2d[:, :, 0].clone()
60
61
62class PositionalEncoding(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected