code: def __iter__(self):
      c_f.LOGGER.info(
          "Computing embeddings in {}".format(self.__class__.__name__)
      )
  
      if self.subset_size:
          indices = c_f.safe_random_choice(
              np.arange(len(self.dataset)), size=self.subset_size
          )
          curr_dataset = torch.utils.data.Subset(self.dataset, indices)
      else:
          indices = torch.arange(len(self.dataset), device=self.device)
          curr_dataset = self.dataset
  
      embeddings, labels = self.tester.get_all_embeddings(
          curr_dataset, self.model
      )
      labels = labels.squeeze(1)
      hard_tuples = self.miner(embeddings, labels)
  
      self.weights = torch.zeros(len(self.dataset), device=self.device)
      self.weights[indices] = lmu.convert_to_weights(
          hard_tuples, labels, dtype=torch.float32
      )
      return iter(
          torch.utils.data.WeightedRandomSampler(
              self.weights, self.__len__(), replacement=True
          )
      )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/samplers/tuples_to_weights_sampler.py
imports: import numpy
  import torch
  from torch.utils.data.sampler import Sampler
  from ..testers import BaseTester
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
label_desc: Use image node_id 3 for calling the TuplesToWeightsSampler obj's underlying member method code with example usage: obj.__iter__() and returns: iter