code: def __init__(
      self, model, miner, dataset, subset_size=None, **tester_kwargs
  ):
      self.model = model
      self.miner = miner
      self.dataset = dataset
      self.subset_size = subset_size
      self.tester = BaseTester(**tester_kwargs)
      self.device = self.tester.data_device
      self.weights = None
  
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 1 to create a new TuplesToWeightsSampler object from inherited base classes: Sampler with example: obj = TuplesToWeightsSampler(model, miner, dataset, subset_size)