class_docstr: A triplet batch, composed of a batch of support sets, query contexts and prediction horizons.
  Compared to a simple triplet, it also manages the lengths of all samples.
class_docstr_tok: ["A","triplet","batch",",","composed","of","a","batch","of","support","sets",",","query","contexts","and","prediction","horizons",".","Compared","to","a","simple","triplet",",","it","also","manages","the","lengths","of","all","samples","."]
code: def pin_memory(self):
      self.support_set = self.support_set.pin_memory()
      self.query_past = self.query_past.pin_memory()
      self.query_future = self.query_future.pin_memory()
      return self
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .sampling import Triplet
  from .dataset import TimeSeries
  from meta.common.torch import tensor_to_np
label_desc: Use image node_id 3 for calling the TripletBatch obj's underlying member method code with example usage: obj.pin_memory() and returns: self