Skip to content

Commit 5b1eb28

Browse files
committed
fix: incorrect max calculation implementation
1 parent 6b15735 commit 5b1eb28

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/5-min-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this tutorial, you will use TrainCheck to detect & diagnose the real‑world
66

77
**Prerequisites**
88
- [A working TrainCheck installation](./installation-guide.md)
9-
- `efficientnet_pytorch` (install via `pip3 install efficientnet_pytorch`)
9+
- `efficientnet_pytorch` and `torchvision` (install via `pip3 install efficientnet_pytorch torchvision`)
1010
- A Linux machine with a CUDA‑enabled GPU
1111
- 💡 Tip: If you don’t have a CUDA GPU, you can still run this tutorial on CPU—it’ll just take longer.
1212

traincheck/invariant/lead_relation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def generate_hypothesis(trace) -> list[Hypothesis]:
428428
assert last_example is not None
429429

430430
if event_A_idx >= len(events_A_pre):
431-
max_time = events_B_post["time"].max()
431+
max_time = max([event["time"] for event in events_B_post])
432432
if pre_event_A_time <= max_time:
433433
hypothesis_with_examples[
434434
(func_A, func_B)
@@ -673,7 +673,7 @@ def collect_examples(trace, hypothesis):
673673
break
674674

675675
if event_A_idx >= len(events_A_pre):
676-
max_time = events_B_post["time"].max()
676+
max_time = max([event["time"] for event in events_B_post])
677677
if pre_event_A_time <= max_time:
678678
hypothesis[(func_A, func_B)].positive_examples.add_example(
679679
last_example

0 commit comments

Comments
 (0)