code: def calculate_loss(self, curr_batch):
      data, labels = curr_batch
      embeddings = self.compute_embeddings(data)
      s = 0
      logits = []
      indices_tuple = None
      for i, curr_size in enumerate(self.embedding_sizes):
          curr_loss_name = "metric_loss_%d" % i
          curr_miner_name = "tuple_miner_%d" % i
          curr_classifier_name = "classifier_%d" % i
  
          e = embeddings[:, s : s + curr_size]
          indices_tuple = self.maybe_mine_embeddings(
              e, labels, indices_tuple, curr_miner_name
          )
          self.losses[curr_loss_name] += self.maybe_get_metric_loss(
              e, labels, indices_tuple, curr_loss_name
          )
          logits.append(self.maybe_get_logits(e, curr_classifier_name))
          s += curr_size
  
      for i, L in enumerate(logits):
          if L is None:
              continue
          curr_loss_name = "classifier_loss_%d" % i
          self.losses[curr_loss_name] += self.maybe_get_classifier_loss(
              L, labels, curr_loss_name
          )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/trainers/cascaded_embeddings.py
imports: from ..None import miners
  from ..utils import common_functions
  from .base_trainer import BaseTrainer
label_desc: Use image node_id 2 for calling the CascadedEmbeddings obj's underlying member method code with example usage: obj.calculate_loss(curr_batch) without return types