Skip to content

Commit 70b7691

Browse files
authored
Fix denominator calculation for validation length
1 parent a123419 commit 70b7691

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

the_well/benchmark/trainer/training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def validation_loop(
314314
loss_dict = {}
315315
time_logs = {}
316316
count = 0
317-
denom = len(dataloader) if full else self.short_validation_length
317+
denom = len(dataloader) if full else min(self.short_validation_length, len(dataloader))
318318
with torch.autocast(
319319
self.device.type, enabled=self.enable_amp, dtype=self.amp_type
320320
):

0 commit comments

Comments
 (0)