Initialize view_replay_enabled_ in the AutogradState ctor#100822
Closed
vors wants to merge 1 commit intopytorch:mainfrom
Closed
Initialize view_replay_enabled_ in the AutogradState ctor#100822vors wants to merge 1 commit intopytorch:mainfrom
vors wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100822
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6eacfb3: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Skylion007
approved these changes
May 8, 2023
Collaborator
|
@pytorchbot merge |
Collaborator
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
chuanqi129
pushed a commit
to chuanqi129/pytorch
that referenced
this pull request
Dec 18, 2023
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 25, 2026
…0822) Cruise uses [clang static analyzer](https://clang-analyzer.llvm.org/) internally. In the v2.0.0 release of PyTorch it found this problem ``` In file included from external/pytorch/aten/src/ATen/ATen.h:7: In file included from external/pytorch/aten/src/ATen/Context.h:3: In file included from external/pytorch/aten/src/ATen/CPUGeneratorImpl.h:3: In file included from external/pytorch/aten/src/ATen/core/Generator.h:22: In file included from external/pytorch/c10/core/GeneratorImpl.h:8: In file included from external/pytorch/c10/core/TensorImpl.h:6: external/pytorch/c10/core/InferenceMode.h:58:5: warning: Passed-by-value struct argument contains uninitialized data (e.g., field: 'view_replay_enabled_') AutogradState::set_tls_state(AutogradState( ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. ``` In other words, the value of `view_replay_enabled_` could be initialized which may lead to subtle bugs later on. This PR addresses the warning by explicitly initializing it to `false`. Pull Request resolved: pytorch#100822 Approved by: https://github.com/Skylion007
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cruise uses clang static analyzer internally.
In the v2.0.0 release of PyTorch it found this problem
In other words, the value of
view_replay_enabled_could be initialized which may lead to subtle bugs later on.This PR addresses the warning by explicitly initializing it to
false.