Skip to content

Commit

Permalink
Merge pull request #374 from richardrl/enable_temporal_frame_loading
Browse files Browse the repository at this point in the history
Enable temporal frame loading
  • Loading branch information
andrewilyas authored May 6, 2024
2 parents 77f1124 + c840ebf commit 9834429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,5 @@ dmypy.json

# Cython debug symbols
cython_debug/

.idea/
7 changes: 4 additions & 3 deletions ffcv/loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def __init__(self,
drop_last: bool = True,
batches_ahead: int = 3,
recompile: bool = False, # Recompile at every epoch
order_kwargs: dict = dict(),
):

if distributed and order == OrderOption.RANDOM and (seed is None):
Expand Down Expand Up @@ -156,8 +157,8 @@ def __init__(self,

if order in ORDER_MAP:
self.traversal_order: TraversalOrder = ORDER_MAP[order](self)
elif isinstance(order, TraversalOrder):
self.traversal_order: TraversalOrder = order(self)
elif issubclass(order, TraversalOrder):
self.traversal_order: TraversalOrder = order(self, **order_kwargs)
else:
raise ValueError(f"Order {order} is not a supported order type or a subclass of TraversalOrder")

Expand All @@ -180,7 +181,7 @@ def __init__(self,
elif spec is None:
continue # This is a disabled field
else:
msg = f"The pipeline for {output_name} has to be "
msg = f"The pipeline for {output_name} has to be "
msg += f"either a PipelineSpec or a sequence of operations"
raise ValueError(msg)
custom_pipeline_specs[output_name] = spec
Expand Down

0 comments on commit 9834429

Please sign in to comment.