(shape, dtype=None, device=None, requires_grad=True)
| 28 | |
| 29 | |
| 30 | def make_grid(shape, dtype=None, device=None, requires_grad=True): |
| 31 | ranges = [torch.arange(float(s), dtype=dtype, device=device, requires_grad=requires_grad) for s in shape] |
| 32 | grid = torch.stack(meshgrid_ij(*ranges), dim=-1) |
| 33 | return grid[None] |
| 34 | |
| 35 | |
| 36 | # 1D combinations of bounds/interpolations |
no test coverage detected
searching dependent graphs…