Skip to content

Commit fdc6310

Browse files
authored
note: torch.zeros -> torch.empty (#13807)
* note: torch.zeros -> torch.empty * move to gotchas.
1 parent 3bc3e52 commit fdc6310

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.ai/models.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,5 @@ Boolean gate. If `False` (default), calling that method raises `ValueError`. All
172172
freqs_dtype = torch.float32 if (is_mps or is_npu) else torch.float64
173173
```
174174
See `transformer_flux.py`, `transformer_flux2.py`, `transformer_wan.py`, `unet_2d_condition.py` for reference usages. Never leave an unconditional `torch.float64` in the model.
175+
176+
6. **Using `torch.empty`.** - Do not use `torch.empty` to initialize parameters. Use `torch.zeros` or `torch.ones`, instead.

0 commit comments

Comments
 (0)