MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / forward

Method forward

modules/ball_query.py:16–30  ·  view source on GitHub ↗
(self, points_coords, centers_coords, temb, points_features=None)

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected