aboutsummaryrefslogtreecommitdiff
path: root/modules/extensions.py
diff options
context:
space:
mode:
authorbrkirch <brkirch@users.noreply.github.com>2023-07-25 03:03:06 -0400
committerbrkirch <brkirch@users.noreply.github.com>2023-08-13 10:06:25 -0400
commit2489252099c299bed49a9d4a39a4ead73b6b6f10 (patch)
tree98950f6d50e0a93d08dcb7134db93c49777c460f /modules/extensions.py
parent87dd685224b5f7dbbd832fc73cc08e7e470c9f28 (diff)
`torch.empty` can create issues; use `torch.zeros`
For MPS, using a tensor created with `torch.empty()` can cause `torch.baddbmm()` to include NaNs in the tensor it returns, even though `beta=0`. However, with a tensor of shape [1,1,1], there should be a negligible performance difference between `torch.empty()` and `torch.zeros()` anyway, so it's better to just use `torch.zeros()` for this and avoid unnecessarily creating issues.
Diffstat (limited to 'modules/extensions.py')
0 files changed, 0 insertions, 0 deletions