code: def add_item(self, tensor):
      bytes = self.out_file.write(
          np.array(tensor.numpy(), dtype=self.dtype)
      )
      self.data_offsets.append(
          self.data_offsets[-1] + bytes / self.element_size
      )
      for s in tensor.size():
          self.sizes.append(s)
      self.dim_offsets.append(self.dim_offsets[-1] + len(tensor.size()))
  
imports: import os
  import shutil
  import struct
  from functools import lru_cache
  from itertools import accumulate
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the IndexedDatasetBuilder obj's underlying member method code with example usage: obj.add_item(tensor) without return types