code: def compute_objectness_loss(
      inputs, outputs: VoteNetResults, loss_params
  ):
      """Compute objectness loss for the proposals.
  
      Args:
          end_points: dict (read-only)
  
      Returns:
          objectness_loss: scalar Tensor
          objectness_label: (batch_size, num_aggregated) Tensor with value 0 or 1
          objectness_mask: (batch_size, num_aggregated) Tensor with value 0 or 1
          object_assignment: (batch_size, num_aggregated) Tensor with long int
              within [0,num_gt_object-1]
      """
      # Compute objectness loss
      objectness_scores = outputs["objectness_scores"]
      weights = torch.tensor(loss_params.objectness_cls_weights).to(
          objectness_scores.device
      )
      criterion = nn.CrossEntropyLoss(weights, reduction="none")
      objectness_loss = criterion(
          objectness_scores.transpose(2, 1), outputs.objectness_label
      )
      objectness_loss = torch.sum(
          objectness_loss * outputs.objectness_mask
      ) / (torch.sum(outputs.objectness_mask) + 1e-6)
  
      return objectness_loss
  
file_path: torch-points3d/torch_points3d/modules/VoteNet/loss_helper.py
imports: import torch
  import torch.nn
  import numpy
  from torch_points3d.core.losses import huber_loss, nn_distance
  from .votenet_results import VoteNetResults
label_desc: Use image node_id 2 for calling a global function with example usage: compute_objectness_loss(inputs, outputs, loss_params) and returns: objectness_loss