code: def _compute_loss(self):
      # Semantic loss
      self.semantic_loss = torch.nn.functional.nll_loss(
          self.output.semantic_logits,
          self.labels.y,
          ignore_index=IGNORE_LABEL,
      )
      self.loss = self.opt.loss_weights.semantic * self.semantic_loss
  
      # Offset loss
      self.input.instance_mask = self.input.instance_mask.to(
          self.device
      )
      self.input.vote_label = self.input.vote_label.to(self.device)
      offset_losses = offset_loss(
          self.output.offset_logits[self.input.instance_mask],
          self.input.vote_label[self.input.instance_mask],
          torch.sum(self.input.instance_mask),
      )
      for loss_name, loss in offset_losses.items():
          setattr(self, loss_name, loss)
          self.loss += self.opt.loss_weights[loss_name] * loss
  
      # Score loss
      if self.output.cluster_scores is not None and self._scorer_type:
          self.score_loss = instance_iou_loss(
              self.output.clusters,
              self.output.cluster_scores,
              self.input.instance_labels.to(self.device),
              self.input.batch.to(self.device),
              min_iou_threshold=self.opt.min_iou_threshold,
              max_iou_threshold=self.opt.max_iou_threshold,
          )
          self.loss += (
              self.score_loss * self.opt.loss_weights["score_loss"]
          )
  
imports: import torch
  import os
  from torch_points_kernels import region_grow
  from torch_geometric.data import Data
  from torch_scatter import scatter
  import random
  from torch_points3d.datasets.segmentation import IGNORE_LABEL
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.applications.minkowski import Minkowski
  from torch_points3d.core.common_modules import Seq, MLP, FastBatchNorm1d
  from torch_points3d.core.losses import offset_loss, instance_iou_loss
  from torch_points3d.core.data_transform import GridSampling3D
  from .structures import PanopticLabels, PanopticResults
  from torch_points3d.utils import is_list
label_desc: Use image node_id 6 for calling the PointGroup obj's underlying member method code with example usage: obj._compute_loss() without return types