fastdev.geom.utils ================== .. py:module:: fastdev.geom.utils Module Contents --------------- .. py:function:: masked_gather(points: torch.Tensor, idx: torch.Tensor) -> torch.Tensor Helper function for torch.gather to collect the points at the given indices in idx where some of the indices might be -1 to indicate padding. These indices are first replaced with 0. Then the points are gathered after which the padded values are set to 0.0. :param points: (N, P, D) float32 tensor of points :param idx: (N, K) or (N, P, K) long tensor of indices into points, where some indices are -1 to indicate padding :returns: (N, K, D) float32 tensor of points at the given indices :rtype: selected_points