Skip to content

Commit

Permalink
Fix logic bug in checking ffcv
Browse files Browse the repository at this point in the history
Fixes #5.  Now we check for ffcv after we have properly determined if
we need it (which is in the tsimcne.fit() function call).
  • Loading branch information
jnboehm committed Dec 6, 2023
1 parent 0c88922 commit 7f6b2b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tsimcne/tsimcne.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def _handle_parameters(self):
f"but got {self.freeze_schedule}."
)

if self.use_ffcv:
@staticmethod
def check_ffcv(use_ffcv):
if use_ffcv:
try:
import ffcv

Expand Down Expand Up @@ -406,6 +408,7 @@ def fit(self, X: torch.utils.data.Dataset | str):
self.use_ffcv = True
else:
self.use_ffcv = False
self.check_ffcv(self.use_ffcv)

train_dl = self.make_dataloader(X, True, None)

Expand Down

0 comments on commit 7f6b2b4

Please sign in to comment.