class_docstr: :class:`KGDataLoader` is a dataloader which would return the triplets with negative examples
  in a knowledge graph.
  
  Args:
      config (Config): The config of dataloader.
      dataset (Dataset): The dataset of dataloader.
      sampler (KGSampler): The knowledge graph sampler of dataloader.
      shuffle (bool, optional): Whether the dataloader will be shuffle after a round. Defaults to ``False``.
  
  Attributes:
      shuffle (bool): Whether the dataloader will be shuffle after a round.
          However, in :class:`KGDataLoader`, it's guaranteed to be ``True``.
class_docstr_tok: [":","class",":","`","KGDataLoader","`","is","a","dataloader","which","would","return","the","triplets","with","negative","examples","in","a","knowledge","graph",".","Args",":","config","(","Config",")",":","The","config","of","dataloader",".","dataset","(","Dataset",")",":","The","dataset","of","dataloader",".","sampler","(","KGSampler",")",":","The","knowledge","graph","sampler","of","dataloader",".","shuffle","(","bool",",","optional",")",":","Whether","the","dataloader","will","be","shuffle","after","a","round",".","Defaults","to","``","False","``",".","Attributes",":","shuffle","(","bool",")",":","Whether","the","dataloader","will","be","shuffle","after","a","round",".","However",",","in",":","class",":","`","KGDataLoader","`",",","it","'s","guaranteed","to","be","``","True","``","."]
code: def __init__(self, config, dataset, sampler, shuffle=False):
      self.logger = getLogger()
      if shuffle is False:
          shuffle = True
          self.logger.warning(
              "kg based dataloader must shuffle the data"
          )
  
      self.neg_sample_num = 1
  
      self.neg_prefix = config["NEG_PREFIX"]
      self.hid_field = dataset.head_entity_field
      self.tid_field = dataset.tail_entity_field
  
      # kg negative cols
      self.neg_tid_field = self.neg_prefix + self.tid_field
      dataset.copy_field_property(self.neg_tid_field, self.tid_field)
  
      self.sample_size = len(dataset.kg_feat)
      super().__init__(config, dataset, sampler, shuffle=shuffle)
  
file_path: RecBole/recbole/data/dataloader/knowledge_dataloader.py
imports: from logging import getLogger
  from recbole.data.dataloader.abstract_dataloader import AbstractDataLoader
  from recbole.data.dataloader.general_dataloader import TrainDataLoader
  from recbole.data.interaction import Interaction
  from recbole.utils import InputType, KGDataLoaderState
  import numpy
label_desc: Use image node_id 1 to create a new KGDataLoader object from inherited base classes: AbstractDataLoader with example: obj = KGDataLoader(config, dataset, sampler, shuffle)