(b, h, w)
| 91 | return x |
| 92 | |
| 93 | def _compute_source_index(b, h, w): |
| 94 | y = grid[b, 1, h, w] |
| 95 | x = grid[b, 0, h, w] |
| 96 | y, x = _unnormalize(y, x) |
| 97 | |
| 98 | if padding_mode == "reflection": |
| 99 | y = _reflect_coordinates(y, in_height) |
| 100 | x = _reflect_coordinates(x, in_width) |
| 101 | y = _clip_coordinates(y, in_height) |
| 102 | x = _clip_coordinates(x, in_width) |
| 103 | elif padding_mode == "border": |
| 104 | y = _clip_coordinates(y, in_height) |
| 105 | x = _clip_coordinates(x, in_width) |
| 106 | |
| 107 | return (y, x) |
| 108 | |
| 109 | def _nearest_sample(): |
| 110 | for _b in range(batch): |
no test coverage detected
searching dependent graphs…