Ejemplo n.º 1
0
 def _repeat_one_sequence(self, x: torch.Tensor, d: torch.LongTensor):
     if d.sum() == 0:
         # FIXME
         d = d.fill_(1)
     return torch.cat(
         [x_.repeat(int(d_), 1) for x_, d_ in zip(x, d) if d_ != 0], dim=0)