class_docstr: Serialize datapoints to bytes (by tensorpack's default serializer) and write to a TFRecord file.
  
  Note that TFRecord does not support random access and is in fact not very performant.
  It's better to use :class:`LMDBSerializer`.
class_docstr_tok: ["Serialize","datapoints","to","bytes","(","by","tensorpack","'s","default","serializer",")","and","write","to","a","TFRecord","file",".","Note","that","TFRecord","does","not","support","random","access","and","is","in","fact","not","very","performant",".","It","'s","better","to","use",":","class",":","`","LMDBSerializer","`","."]
docstr: Args:
      size (int): total number of records. If not provided, the returned dataflow will have no `__len__()`.
          It's needed because this metadata is not stored in the TFRecord file.
docstr_tok: ["Args",":","size","(","int",")",":","total","number","of","records",".","If","not","provided",",","the","returned","dataflow","will","have","no","`","__len__","(",")","`",".","It","'s","needed","because","this","metadata","is","not","stored","in","the","TFRecord","file","."]
code: def load(path, size=None):
      """
      Args:
          size (int): total number of records. If not provided, the returned dataflow will have no `__len__()`.
              It's needed because this metadata is not stored in the TFRecord file.
      """
      gen = tf.python_io.tf_record_iterator(path)
      ds = DataFromGenerator(gen)
      ds = MapData(ds, loads)
      if size is not None:
          ds = FixedSizeData(ds, size)
      return ds
  
imports: import numpy
  import os
  import platform
  from collections import defaultdict
  from ..utils import logger
  from ..utils.serialize import dumps, loads
  from ..utils.develop import create_dummy_class
  from ..utils.utils import get_tqdm
  from .base import DataFlow
  from .common import FixedSizeData, MapData
  from .format import HDF5Data, LMDBData, DiskCacheData
  from .raw import DataFromGenerator, DataFromList
label_desc: Use image node_id 2 for calling the TFRecordSerializer obj's underlying member method code with example usage: obj.load(path, size) and returns: ds