You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/seeding.md
+13-25Lines changed: 13 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,35 +40,24 @@ This creates a `DefaultSeedGenerator` internally and passes it to all setup meth
40
40
41
41
### Disabling Seeding
42
42
43
-
When you don't pass a `seed` parameter (or pass `seed=None`), seeding is disabled:
43
+
If you don't need seeding, you can simply ignore the seed generators. However, in workflows where you mix seeded and non-seeded runs, you can disable seeding without writing `if/else` statements to check whether a seed is provided.
44
44
45
-
```python
46
-
# No seed = seeding disabled
47
-
benchmark = MyBenchmark()
48
-
49
-
# Explicit None = also disabled
50
-
benchmark = MyBenchmark(seed=None)
51
-
```
52
-
53
-
When seeding is disabled:
45
+
To disable seeding, omit the `seed` parameter when creating your `Benchmark` or `DefaultSeedGenerator` (or pass `seed=None`):
54
46
55
47
1. A `DefaultSeedGenerator(global_seed=None)` is still created internally
56
-
2. Setup methods still receive a `seed_generator` parameter (it's never `None`)
48
+
2. Setup methods still receive a `seed_generator` parameter
57
49
3.`derive_seed()` returns `None` instead of an integer
58
-
4. This `None` flows directly to model adapters (which accept `Optional[int]`)
59
-
60
-
This design simplifies setup method implementations—you don't need `if seed_generator is not None:` checks:
0 commit comments