def get_loss(self, seed_points, vote_points, seed_indices, vote_targets_mask, vote_targets):
    'Calculate loss of voting module.\n\n        Args:\n            seed_points (torch.Tensor): Coordinate of the seed points.\n            vote_points (torch.Tensor): Coordinate of the vote points.\n            seed_indices (torch.Tensor): Indices of seed points in raw points.\n            vote_targets_mask (torch.Tensor): Mask of valid vote targets.\n            vote_targets (torch.Tensor): Targets of votes.\n\n        Returns:\n            torch.Tensor: Weighted vote loss.\n        '
    (batch_size, num_seed) = seed_points.shape[:2]
    seed_gt_votes_mask = torch.gather(vote_targets_mask, 1, seed_indices).float()
    seed_indices_expand = seed_indices.unsqueeze((- 1)).repeat(1, 1, (3 * self.gt_per_seed))
    seed_gt_votes = torch.gather(vote_targets, 1, seed_indices_expand)
    seed_gt_votes += seed_points.repeat(1, 1, 3)
    weight = (seed_gt_votes_mask / (torch.sum(seed_gt_votes_mask) + 1e-06))
    distance = self.vote_loss(vote_points.view((batch_size * num_seed), (- 1), 3), seed_gt_votes.view((batch_size * num_seed), (- 1), 3), dst_weight=weight.view((batch_size * num_seed), 1))[1]
    vote_loss = torch.sum(torch.min(distance, dim=1)[0])
    return vote_loss
Calculate loss of voting module.

Args:
    seed_points (torch.Tensor): Coordinate of the seed points.
    vote_points (torch.Tensor): Coordinate of the vote points.
    seed_indices (torch.Tensor): Indices of seed points in raw points.
    vote_targets_mask (torch.Tensor): Mask of valid vote targets.
    vote_targets (torch.Tensor): Targets of votes.

Returns:
    torch.Tensor: Weighted vote loss.
def get_loss(self, seed_points, vote_points, seed_indices, vote_targets_mask, vote_targets):
    'Calculate loss of voting module.\n\n        Args:\n            seed_points (torch.Tensor): Coordinate of the seed points.\n            vote_points (torch.Tensor): Coordinate of the vote points.\n            seed_indices (torch.Tensor): Indices of seed points in raw points.\n            vote_targets_mask (torch.Tensor): Mask of valid vote targets.\n            vote_targets (torch.Tensor): Targets of votes.\n\n        Returns:\n            torch.Tensor: Weighted vote loss.\n        '
    (batch_size, num_seed) = seed_points.shape[:2]
    seed_gt_votes_mask = torch.gather(vote_targets_mask, 1, seed_indices).float()
    seed_indices_expand = seed_indices.unsqueeze((- 1)).repeat(1, 1, (3 * self.gt_per_seed))
    seed_gt_votes = torch.gather(vote_targets, 1, seed_indices_expand)
    seed_gt_votes += seed_points.repeat(1, 1, 3)
    weight = (seed_gt_votes_mask / (torch.sum(seed_gt_votes_mask) + 1e-06))
    distance = self.vote_loss(vote_points.view((batch_size * num_seed), (- 1), 3), seed_gt_votes.view((batch_size * num_seed), (- 1), 3), dst_weight=weight.view((batch_size * num_seed), 1))[1]
    vote_loss = torch.sum(torch.min(distance, dim=1)[0])
    return vote_loss