input: radius: float, radius of the balls nsample: int, maximum number of features in the balls xyz: torch.Tensor, (b, n, 3) xyz coordinates of the features new_xyz: torch.Tensor, (b, m, 3) centers of the ball query output: (b, m, nsample
(ctx, radius: float, nsample: int, xyz: torch.Tensor, new_xyz: torch.Tensor)
| 203 | class BallQuery(Function): |
| 204 | @staticmethod |
| 205 | def forward(ctx, radius: float, nsample: int, xyz: torch.Tensor, new_xyz: torch.Tensor) -> torch.Tensor: |
| 206 | """ |
| 207 | input: radius: float, radius of the balls |
| 208 | nsample: int, maximum number of features in the balls |
| 209 | xyz: torch.Tensor, (b, n, 3) xyz coordinates of the features |
| 210 | new_xyz: torch.Tensor, (b, m, 3) centers of the ball query |
| 211 | output: (b, m, nsample) tensor with the indicies of the features that form the query balls |
| 212 | """ |
| 213 | assert xyz.is_contiguous() |
| 214 | assert new_xyz.is_contiguous() |
| 215 | b, n, _ = xyz.size() |
| 216 | m = new_xyz.size(1) |
| 217 | idx = torch.cuda.IntTensor(b, m, nsample).zero_() |
| 218 | pointops_cuda.ballquery_cuda(b, n, m, radius, nsample, new_xyz, xyz, idx) |
| 219 | return idx |
| 220 | |
| 221 | @staticmethod |
| 222 | def backward(ctx, a=None): |
nothing calls this directly
no outgoing calls
no test coverage detected