class_docstr: Implementation of a single process tensor storage which stores data in a file
code: def __init__(
      self, data_schema: Dict[str, SizeData], fpath: str, mode: str
  ):
      self.fpath = fpath
      assert (
          "b" in mode
      ), f"Tensor storage should be opened in binary mode, got '{mode}'"
      if "w" in mode:
          # pyre-fixme[6]: For 2nd argument expected `Union[typing_extensions.Liter...
          file_h = PathManager.open(fpath, mode)
      elif "r" in mode:
          local_fpath = PathManager.get_local_path(fpath)
          file_h = open(local_fpath, mode)
      else:
          raise ValueError(
              f"Unsupported file mode {mode}, supported modes: rb, wb"
          )
      super().__init__(data_schema, file_h)
  
imports: import io
  import numpy
  import os
  from dataclasses import dataclass
  from functools import reduce
  from operator import mul
  from typing import BinaryIO, Dict, Optional, Tuple
  import torch
  from detectron2.utils.comm import gather, get_rank
  from detectron2.utils.file_io import PathManager
label_desc: Use image node_id 1 to create a new SingleProcessFileTensorStorage object from inherited base classes: SingleProcessTensorStorage with example: obj = SingleProcessFileTensorStorage(data_schema, fpath, mode)