code: def __init__(
      self,
      head_index: Tensor,
      rel_type: Tensor,
      tail_index: Tensor,
      **kwargs,
  ):
      self.head_index = head_index
      self.rel_type = rel_type
      self.tail_index = tail_index
  
      super().__init__(
          range(head_index.numel()), collate_fn=self.sample, **kwargs
      )
  
imports: from typing import List, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 to create a new KGTripletLoader object from inherited base classes: torch.utils.data with example: obj = KGTripletLoader(head_index, rel_type, tail_index)