class_docstr: An iterator that yields Event protos as serialized bytestrings.
class_docstr_tok: ["An","iterator","that","yields","Event","protos","as","serialized","bytestrings","."]
docstr: Constructs a RawEventFileLoader for the given file path.
  
  Args:
    file_path: the event file path to read from
    detect_file_replacement: if True, when Load() is called, the loader
        will make a stat() call to check the size of the file. If it sees
        that the file has grown, it will reopen the file entirely (while
        preserving the current offset) before attempting to read from it.
        Otherwise, Load() will simply poll at EOF for new data.
docstr_tok: ["Constructs","a","RawEventFileLoader","for","the","given","file","path",".","Args",":","file_path",":","the","event","file","path","to","read","from","detect_file_replacement",":","if","True",",","when","Load","(",")","is","called",",","the","loader","will","make","a","stat","(",")","call","to","check","the","size","of","the","file",".","If","it","sees","that","the","file","has","grown",",","it","will","reopen","the","file","entirely","(","while","preserving","the","current","offset",")","before","attempting","to","read","from","it",".","Otherwise",",","Load","(",")","will","simply","poll","at","EOF","for","new","data","."]
code: def __init__(self, file_path, detect_file_replacement=False):
      """Constructs a RawEventFileLoader for the given file path.
  
      Args:
        file_path: the event file path to read from
        detect_file_replacement: if True, when Load() is called, the loader
            will make a stat() call to check the size of the file. If it sees
            that the file has grown, it will reopen the file entirely (while
            preserving the current offset) before attempting to read from it.
            Otherwise, Load() will simply poll at EOF for new data.
      """
      if file_path is None:
          raise ValueError("A file path is required")
      self._file_path = platform_util.readahead_file_path(file_path)
      self._detect_file_replacement = detect_file_replacement
      self._file_size = None
      self._iterator = _make_tf_record_iterator(self._file_path)
      if self._detect_file_replacement and not hasattr(
          self._iterator, "reopen"
      ):
          logger.warning(
              "File replacement detection requested, but not enabled because "
              "TF record iterator impl does not support reopening. This "
              "functionality requires TensorFlow 2.9+"
          )
          self._detect_file_replacement = False
  
imports: import contextlib
  from tensorboard import data_compat
  from tensorboard import dataclass_compat
  from tensorboard.compat import tf
  from tensorboard.compat.proto import event_pb2
  from tensorboard.util import platform_util
  from tensorboard.util import tb_logging
label_desc: Use image node_id 1 to create a new RawEventFileLoader object  with example: obj = RawEventFileLoader(file_path, detect_file_replacement)