-
Notifications
You must be signed in to change notification settings - Fork 712
Replace torch.empty with torch.zeros #6478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace torch.empty with torch.zeros #6478
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6478
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ce906a1 with merge base e93ad5f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D64875312 |
Summary: X-link: pytorch/executorch#6478 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
8aa7d11 to
c74b0b7
Compare
Summary: X-link: pytorch/ao#1157 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
|
This pull request was exported from Phabricator. Differential Revision: D64875312 |
Summary: X-link: pytorch/executorch#6478 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
Summary: X-link: pytorch/ao#1157 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
c74b0b7 to
c5ede25
Compare
|
This pull request was exported from Phabricator. Differential Revision: D64875312 |
Summary: X-link: pytorch/executorch#6478 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
Summary: X-link: pytorch/ao#1157 It turns out that it is unsafe to use `torch.empty` in oss environment because `torch.empty` creates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior. This PR replaces `torch.empty` with `torch.zeros` to make sure that they are properly initialized and avoid inconsistent behaviors. Reviewed By: msaroufim Differential Revision: D64875312
c5ede25 to
ce906a1
Compare
|
This pull request was exported from Phabricator. Differential Revision: D64875312 |
Summary:
It turns out that it is unsafe to use
torch.emptyin oss environment becausetorch.emptycreates tensor with uninitialized data. That means the buffer could be initialized with random values depends on what is left on that piece of memory. This causes code to generate inconsistent behavior.This PR replaces
torch.emptywithtorch.zerosto make sure that they are properly initialized and avoid inconsistent behaviors.Differential Revision: D64875312