code: def to_dense_labels(data):
      if data.batch is not None:
          batch_size = len(torch.unique(data.batch))
      else:
          batch_size = data.pos.shape[0]
  
      data["heading_class_label"] = data["heading_class_label"].view(
          (batch_size, -1)
      )
      data["heading_residual_label"] = data[
          "heading_residual_label"
      ].view((batch_size, -1))
      data["size_class_label"] = data["size_class_label"].view(
          (batch_size, -1)
      )
      data["size_residual_label"] = data["size_residual_label"].view(
          (batch_size, -1, 3)
      )
      data["sem_cls_label"] = data["sem_cls_label"].view(
          (batch_size, -1)
      )
      data["instance_box_corners"] = data["instance_box_corners"].view(
          (batch_size, -1, 8, 3)
      )
      data["box_label_mask"] = data["box_label_mask"].view(
          (batch_size, -1)
      )
      if data["center_label"].dim() == 3:
          data["gt_center"] = data["center_label"][:, :, 0:3]
      else:
          data["gt_center"] = data["center_label"][:, 0:3].view(
              (batch_size, -1, 3)
          )
      return data
  
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 4 for calling a global function with example usage: to_dense_labels(data) and returns: data