class_docstr: Batches are sampled from sorted buckets of data.
  
  First, partition data in buckets of size `batch_size * mult`.
  Each bucket contains `batch_size * mult` elements. The samples inside each bucket are sorted
  based on sort_key and then batched.
  
  Parameters
  ----------
  sort_keys
      The keys to sort the samples.
  batch_size
      Batch size of the sampler.
  mult
      The multiplier to determine the bucket size. Each bucket will have size `mult * batch_size`.
  reverse
      Whether to sort in descending order.
  shuffle
      Whether to shuffle the data.
  seed
      The seed of the internal random number generator
  
  Examples
  --------
  >>> lengths = [np.random.randint(1, 1000) for _ in range(1000)]
  >>> sampler = gluonnlp.data.SortedBucketSampler(lengths, 16)
  >>> # The sequence lengths within the batch will be sorted
  >>> for i, indices in enumerate(sampler):
  ...     if i == 0:
  ...         print([lengths[ele] for ele in indices])
  [-etc-]
class_docstr_tok: ["Batches","are","sampled","from","sorted","buckets","of","data",".","First",",","partition","data","in","buckets","of","size","`","batch_size","*","mult","`",".","Each","bucket","contains","`","batch_size","*","mult","`","elements",".","The","samples","inside","each","bucket","are","sorted","based","on","sort_key","and","then","batched",".","Parameters","--","--","--","--","--","sort_keys","The","keys","to","sort","the","samples",".","batch_size","Batch","size","of","the","sampler",".","mult","The","multiplier","to","determine","the","bucket","size",".","Each","bucket","will","have","size","`","mult","*","batch_size","`",".","reverse","Whether","to","sort","in","descending","order",".","shuffle","Whether","to","shuffle","the","data",".","seed","The","seed","of","the","internal","random","number","generator","Examples","--","--","--","--",">",">",">","lengths","=","[","np.random.randint","(","1",",","1000",")","for","_","in","range","(","1000",")","]",">",">",">","sampler","=","gluonnlp.data.SortedBucketSampler","(","lengths",",","16",")",">",">",">","#","The","sequence","lengths","within","the","batch","will","be","sorted",">",">",">","for","i",",","indices","in","enumerate","(","sampler",")",":","...","if","i","==","0",":","...","print","(","[","lengths","[","ele","]","for","ele","in","indices","]",")","[","-etc-","]"]
docstr: Access the internal random number generator. This helps with reproducible research.
docstr_tok: ["Access","the","internal","random","number","generator",".","This","helps","with","reproducible","research","."]
code: def rng(self):
      """Access the internal random number generator. This helps with reproducible research."""
      return self._rng
  
imports: import math
  import random
  import warnings
  import numpy
  import abc
  import logging
  from typing import Union, Sequence, Optional, List
  from ..base import INT_TYPES
label_desc: Use image node_id 3 for calling the SortedBucketSampler obj's underlying member method code with example usage: obj.rng() and returns: self