(batch, ht, wd, device='cpu')
| 156 | |
| 157 | |
| 158 | def coords_grid(batch, ht, wd, device='cpu'): |
| 159 | coords = torch.meshgrid(torch.arange(ht, device=device), torch.arange(wd, device=device)) |
| 160 | coords = torch.stack(coords[::-1], dim=0).float() |
| 161 | return coords[None].repeat(batch, 1, 1, 1) |
| 162 | |
| 163 | |
| 164 | def upflow8(flow, mode='bilinear'): |
no outgoing calls
no test coverage detected