code: def __init__(self, loader: "Loader", order: Sequence[int]):
      super().__init__(daemon=True)
      self.loader: "Loader" = loader
      self.order = order
      self.metadata = loader.reader.metadata
      self.current_batch_slot = 0
      batches = list(chunks(order, self.loader.batch_size))
      self.iter_ixes = iter(batches)
      self.closed = False
      self.output_queue = Queue(self.loader.batches_ahead)
      self.terminate_event = Event()
      self.memory_context = self.loader.memory_manager.schedule_epoch(
          batches
      )
  
      if IS_CUDA:
          self.current_stream = ch.cuda.current_stream()
  
      try:
          self.memory_context.__enter__()
      except MemoryError as e:
          if loader.traversal_order != QuasiRandom:
              print(QUASIRANDOM_ERROR_MSG)
              print("Full error below:")
  
          raise e
  
      self.storage_state = self.memory_context.state
  
      self.cuda_streams = [
          (ch.cuda.Stream() if IS_CUDA else None)
          for _ in range(self.loader.batches_ahead + 2)
      ]
  
      self.memory_allocations = self.loader.graph.allocate_memory(
          self.loader.batch_size, self.loader.batches_ahead + 2
      )
  
      self.start()
  
file_path: ffcv/ffcv/loader/epoch_iterator.py
imports: from collections import defaultdict
  from threading import Thread, Event
  from queue import Queue, Full
  from contextlib import nullcontext
  from typing import Sequence, TYPE_CHECKING
  import torch
  from ..traversal_order.quasi_random import QuasiRandom
  from ..utils import chunks
  from ..pipeline.compiler import Compiler
label_desc: Use image node_id 1 to create a new EpochIterator object from inherited base classes: Thread with example: obj = EpochIterator(loader, order)