class_docstr: A weighted sampler wrt the pair wise KL divergence.
  The very first batch after initialization is sampled randomly,
  with the next ones being sampled according to the last batch,
  including the first batch in the next round.
  
  Args:
      batch_kl_div (np.ndarray, torch.Tensor): A :obj:`np.ndarray` or
          :obj:`torch.Tensor`, each element [i, j] contains the pair wise
          KL divergence between batch i and j.
class_docstr_tok: ["A","weighted","sampler","wrt","the","pair","wise","KL","divergence",".","The","very","first","batch","after","initialization","is","sampled","randomly",",","with","the","next","ones","being","sampled","according","to","the","last","batch",",","including","the","first","batch","in","the","next","round",".","Args",":","batch_kl_div","(","np.ndarray",",","torch.Tensor",")",":","A",":","obj",":","`","np.ndarray","`","or",":","obj",":","`","torch.Tensor","`",",","each","element","[","i",",","j","]","contains","the","pair","wise","KL","divergence","between","batch","i","and","j","."]
code: def __init__(
      self, batch_kl_div: Union[np.ndarray, torch.Tensor]
  ) -> None:
      data_source = np.arange(batch_kl_div.shape[0])
      self.data_source = data_source
      self.batch_kl_div = batch_kl_div
      self.last_train_batch_id = 0
      super().__init__(data_source)
  
imports: import logging
  import math
  from typing import Callable, Iterator, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  import torch
  from torch import Tensor
  from tqdm import tqdm
  from torch_geometric.data import Data
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import get_ppr, is_undirected, subgraph
label_desc: Use image node_id 1 to create a new IBMBWeightedSampler object from inherited base classes: torch.utils.data.Sampler with example: obj = IBMBWeightedSampler(batch_kl_div)