(tensor)
| 113 | |
| 114 | # helper methods |
| 115 | def _create_coordinate_tensor(tensor): |
| 116 | axes = [torch.arange(tensor.size(i)) for i in range(2, tensor.dim())] |
| 117 | grids = meshgrid_ij(axes) |
| 118 | coords = torch.stack(grids).to(device=tensor.device, dtype=tensor.dtype) |
| 119 | return torch.stack(tensor.size(0) * [coords], dim=0) |
no test coverage detected
searching dependent graphs…