-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[dynamo][NFC] Rename mutable_local and add documentation
#139339
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/139339
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 9720765 with merge base b82a51b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
||
|
|
||
| class MutableSideEffects(MutableLocalBase): | ||
| class ValueMutationExisting(MutationType): |
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.
Move these to base.py? Thinking if all these are better to have in one file.
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.
It's in the next patch, wanted to make review easier:) #139340
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.
Thanks for working on this. This will greatly help others to onboard on side effects
…139340) As title, this addresses https://github.com/pytorch/pytorch/pull/137905/files#r1806800222. Pull Request resolved: #139340 Approved by: https://github.com/anijain2305 ghstack dependencies: #139339
…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
…39339) This patch addresses the renaming part of pytorch#133027, specifically, it renames the following and adds documentation for relevant classes. 1. `VariableTracker.mutable_local` to `mutation_type` 2. `MatableLocal `to `ValueMutationNew` 3. `MutableSideEffects `to `ValueMutationExisting` 4. `MutableLocalSource` to `SourceType` 5. `MutableLocalSource.Local` to `New` Note that (2), (3) and (5) are mainly to bring consistency between them and `AttributeMutationNew`, `AttributeMutationExisting`. Pull Request resolved: pytorch#139339 Approved by: https://github.com/jansel, https://github.com/mlazos, https://github.com/anijain2305
…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 #139339This patch addresses the renaming part of #133027, specifically, it
renames the following and adds documentation for relevant classes.
VariableTracker.mutable_localtomutation_typeMatableLocaltoValueMutationNewMutableSideEffectstoValueMutationExistingMutableLocalSourcetoSourceTypeMutableLocalSource.LocaltoNewNote that (2), (3) and (5) are mainly to bring consistency between them
and
AttributeMutationNew,AttributeMutationExisting.cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames