class_docstr: Base class for DistributedDataParallel Sampler.
  
  Every subclass should implement `__iter__` method, providing a way to iterate
  over indices of dataset elements.
  
  Args:
      opts: command line argument
      n_data_samples: Number of samples in the dataset
      is_training: Training or validation mode. Default: False
class_docstr_tok: ["Base","class","for","DistributedDataParallel","Sampler",".","Every","subclass","should","implement","`","__iter__","`","method",",","providing","a","way","to","iterate","over","indices","of","dataset","elements",".","Args",":","opts",":","command","line","argument","n_data_samples",":","Number","of","samples","in","the","dataset","is_training",":","Training","or","validation","mode",".","Default",":","False"]
docstr: Helper function to update scales in each sampler. This is typically useful in variable-batch sampler
  
  Subclass is expected to implement this function. By default, we do not do anything
docstr_tok: ["Helper","function","to","update","scales","in","each","sampler",".","This","is","typically","useful","in","variable-batch","sampler","Subclass","is","expected","to","implement","this","function",".","By","default",",","we","do","not","do","anything"]
code: def update_scales(
      self, epoch: int, is_master_node: bool = False, *args, **kwargs
  ) -> None:
      """Helper function to update scales in each sampler. This is typically useful in variable-batch sampler
  
      Subclass is expected to implement this function. By default, we do not do anything
      """
  
imports: import argparse
  import copy
  import math
  import random
  from typing import Any, Iterator, List, Tuple
  import numpy
  import torch
  import torch.distributed
  from torch.utils.data.sampler import Sampler
label_desc: Use image node_id 7 for calling the BaseSamplerDDP obj's underlying member method code with example usage: obj.update_scales(epoch, is_master_node) without return types