(B, Z, Y, X, norm=False)
| 128 | return tensor |
| 129 | |
| 130 | def gridcloud3d(B, Z, Y, X, norm=False): |
| 131 | # we want to sample for each location in the grid |
| 132 | grid_z, grid_y, grid_x = meshgrid3d(B, Z, Y, X, norm=norm) |
| 133 | x = torch.reshape(grid_x, [B, -1]) |
| 134 | y = torch.reshape(grid_y, [B, -1]) |
| 135 | z = torch.reshape(grid_z, [B, -1]) |
| 136 | # these are B x N |
| 137 | xyz = torch.stack([x, y, z], dim=2) |
| 138 | # this is B x N x 3 |
| 139 | return xyz |
| 140 | |
| 141 | def gridcloud2d(B, Y, X, norm=False): |
| 142 | # we want to sample for each location in the grid |
no test coverage detected