(xs, pad)
| 442 | sampled_idx, sampled_depth, sampled_dists = outputs |
| 443 | |
| 444 | def padding_points(xs, pad): |
| 445 | if len(xs) == 1: |
| 446 | return xs[0] |
| 447 | |
| 448 | maxlen = max([x.size(1) for x in xs]) |
| 449 | full_size = sum([x.size(0) for x in xs]) |
| 450 | xt = xs[0].new_ones(full_size, maxlen).fill_(pad) |
| 451 | st = 0 |
| 452 | for i in range(len(xs)): |
| 453 | xt[st: st + xs[i].size(0), : xs[i].size(1)] = xs[i] |
| 454 | st += xs[i].size(0) |
| 455 | return xt |
| 456 | |
| 457 | sampled_idx = padding_points(sampled_idx, -1) |
| 458 | sampled_depth = padding_points(sampled_depth, MAX_DEPTH) |
no test coverage detected