-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[dynamo][NFC] Move MutationType classes into variables/base.py
#139340
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/139340
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 81efec7 with merge base b82a51b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
anijain2305
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice. Thanks! Disregard the comment on the previous PR.
…Tracker` (#139341) This patch adds 2 simple methods `VariableTracker.is_mutable()` and `VariableTracker.is_immutable()`, which helps clarify intention. For instance, rather than writing ```python if var.mutation_type: ... ``` After this patch one can write ```python if var.is_mutable(): ... ``` This patch also simplifies `mutation_type` propagation in some `ListVariable` methods. Pull Request resolved: #139341 Approved by: https://github.com/mlazos, https://github.com/anijain2305 ghstack dependencies: #139339, #139340
…ytorch#139340) As title, this addresses https://github.com/pytorch/pytorch/pull/137905/files#r1806800222. Pull Request resolved: pytorch#139340 Approved by: https://github.com/anijain2305 ghstack dependencies: pytorch#139339
…Tracker` (pytorch#139341) This patch adds 2 simple methods `VariableTracker.is_mutable()` and `VariableTracker.is_immutable()`, which helps clarify intention. For instance, rather than writing ```python if var.mutation_type: ... ``` After this patch one can write ```python if var.is_mutable(): ... ``` This patch also simplifies `mutation_type` propagation in some `ListVariable` methods. Pull Request resolved: pytorch#139341 Approved by: https://github.com/mlazos, https://github.com/anijain2305 ghstack dependencies: pytorch#139339, pytorch#139340
…ytorch#139340) As title, this addresses https://github.com/pytorch/pytorch/pull/137905/files#r1806800222. Pull Request resolved: pytorch#139340 Approved by: https://github.com/anijain2305 ghstack dependencies: pytorch#139339
…Tracker` (pytorch#139341) This patch adds 2 simple methods `VariableTracker.is_mutable()` and `VariableTracker.is_immutable()`, which helps clarify intention. For instance, rather than writing ```python if var.mutation_type: ... ``` After this patch one can write ```python if var.is_mutable(): ... ``` This patch also simplifies `mutation_type` propagation in some `ListVariable` methods. Pull Request resolved: pytorch#139341 Approved by: https://github.com/mlazos, https://github.com/anijain2305 ghstack dependencies: pytorch#139339, pytorch#139340
Stack from ghstack (oldest at bottom):
is_mutable()andis_immutable()methods toVariableTracker#139341MutationTypeclasses intovariables/base.py#139340mutable_localand add documentation #139339As title, this addresses
https://github.com/pytorch/pytorch/pull/137905/files#r1806800222.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames