Skip to content

Commit

Permalink
[docs] update set-seed (#3228)
Browse files Browse the repository at this point in the history
* update set-seed

* update comment
  • Loading branch information
faaany authored Dec 6, 2024
1 parent 60461ff commit 51fd482
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/concept_guides/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ Why is this important? Under the hood this will set **5** different seed setting
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.cuda.manual_seed_all(seed) # or torch.xpu.manual_seed_all, etc
# ^^ safe to call this function even if cuda is not available
if is_torch_xla_available():
xm.set_rng_state(seed)
```

The random state, numpy's state, torch, torch's cuda state, and if TPUs are available torch_xla's cuda state.
The random state, numpy's state, torch, torch's device state, and if TPUs are available torch_xla's cuda state.

## Observed Batch Sizes

Expand Down

0 comments on commit 51fd482

Please sign in to comment.