MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / get_indices_for_repeat

Method get_indices_for_repeat

models/aios/aios_smplx.py:697–713  ·  view source on GitHub ↗

Input: - now_num: int - target_num: int Output: - indices: tensor[target_num]

(now_num, target_num, device='cuda')

Source from the content-addressed store, hash-verified

695
696 # repeat them
697 def get_indices_for_repeat(now_num, target_num, device='cuda'):
698 """
699 Input:
700 - now_num: int
701 - target_num: int
702 Output:
703 - indices: tensor[target_num]
704 """
705 out_indice = []
706 base_indice = torch.arange(now_num).to(device)
707 multiplier = target_num // now_num
708 out_indice.append(base_indice.repeat(multiplier))
709 residue = target_num % now_num
710 out_indice.append(base_indice[torch.randint(0,
711 now_num, (residue, ),
712 device=device)])
713 return torch.cat(out_indice)
714
715 if self.dn_batch_gt_fuse:
716 raise NotImplementedError

Callers

nothing calls this directly

Calls 1

toMethod · 0.45

Tested by

no test coverage detected