(self, points_coords, centers_coords, temb, points_features=None)
| 14 | self.include_coordinates = include_coordinates |
| 15 | |
| 16 | def forward(self, points_coords, centers_coords, temb, points_features=None): |
| 17 | points_coords = points_coords.contiguous() |
| 18 | centers_coords = centers_coords.contiguous() |
| 19 | neighbor_indices = F.ball_query(centers_coords, points_coords, self.radius, self.num_neighbors) |
| 20 | neighbor_coordinates = F.grouping(points_coords, neighbor_indices) |
| 21 | neighbor_coordinates = neighbor_coordinates - centers_coords.unsqueeze(-1) |
| 22 | |
| 23 | if points_features is None: |
| 24 | assert self.include_coordinates, 'No Features For Grouping' |
| 25 | neighbor_features = neighbor_coordinates |
| 26 | else: |
| 27 | neighbor_features = F.grouping(points_features, neighbor_indices) |
| 28 | if self.include_coordinates: |
| 29 | neighbor_features = torch.cat([neighbor_coordinates, neighbor_features], dim=1) |
| 30 | return neighbor_features, F.grouping(temb, neighbor_indices) |
| 31 | |
| 32 | def extra_repr(self): |
| 33 | return 'radius={}, num_neighbors={}{}'.format( |
nothing calls this directly
no outgoing calls
no test coverage detected