code: def sample(self, index: List[int]) -> Tuple[Tensor, Tensor, Tensor]:
      index = torch.tensor(index, device=self.head_index.device)
  
      head_index = self.head_index[index]
      rel_type = self.rel_type[index]
      tail_index = self.tail_index[index]
  
      return head_index, rel_type, tail_index
  
imports: from typing import List, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling the KGTripletLoader obj's underlying member method code with example usage: obj.sample(index) and returns: head_index,  rel_type,  tail_index