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
[dynamo] support dict.copy()
/ OrderedDict.copy()
/ defaultdict.copy()
#115012
Conversation
…copy()` [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/115012
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 78a97a8 with merge base ec124b9 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…copy()` ghstack-source-id: 80327d8b2281a790f820489f969b0e7417195e36 Pull Request resolved: pytorch#115012
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
…copy()` ghstack-source-id: 05dd93f4bddd6c26dd3180253769ee171597a800 Pull Request resolved: pytorch#115012
Adding unit tests to all these PRs would be nice. You also solved some graph breaks in the current benchmarks to the CSV needs to be updated now. |
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
…copy()` ghstack-source-id: 793d09e4e2e6ec10ad65a035565d8698c2b43761 Pull Request resolved: pytorch#115012
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
@make_test | ||
def test_dict_copy(x): | ||
my_list = [("a", x), ("b", x + 1), ("c", x + 2)] | ||
d1 = dict(my_list) | ||
d1["a"] = x + 10 | ||
d2 = d1.copy() | ||
d2["a"] = x - 5 | ||
d2["b"] = x + 3 | ||
d3 = collections.OrderedDict(my_list) | ||
d3["c"] = x + 20 | ||
d4 = d3.copy() | ||
d4["c"] = x - 10 | ||
return d1["a"] * d2["a"] + d2["b"] + d3["c"] * d4["c"] + 1 |
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.
The test for defaultdict.copy
is not added. Because the collections
module is ignored in SKIP_DIRS
. Also seems that the implementation for DefaultDictVariable
is incomplete. Currently, we only support creating an empty defaultdict
with the default_factory
.
dd = defaultdict(int)
We do not support passing a mapping
/ seq2
as the second argument. We also do not support keywords:
dd1 = defaultdict(int, {'a': 1, 'b': 2})
dd2 = defaultdict(int, zip('ab', range(2)))
dd3 = defaultdict(int, a=1, b=2)
dd4 = defaultdict(int, {'a': 1, 'b': 2}, c=3, d=4)
…copy()` ghstack-source-id: cdadc70ba9297179f934b51786b0f35c05134181 Pull Request resolved: pytorch#115012
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
…copy()` ghstack-source-id: 2946be5f996d3f766449fa0b4c10a341c0ba3994 Pull Request resolved: pytorch#115012
…efaultdict.copy()`" cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng [ghstack-poisoned]
…copy()` ghstack-source-id: de0201887125656a8888193a9708279b9d117965 Pull Request resolved: pytorch#115012
…copy()` ghstack-source-id: de0201887125656a8888193a9708279b9d117965 Pull Request resolved: pytorch#115012
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
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 |
…copy()` (pytorch#115012) Pull Request resolved: pytorch#115012 Approved by: https://github.com/jansel ghstack dependencies: pytorch#115010, pytorch#115011
…copy()` (pytorch#115012) Pull Request resolved: pytorch#115012 Approved by: https://github.com/jansel ghstack dependencies: pytorch#115010, pytorch#115011
…copy()` (pytorch#115012) Pull Request resolved: pytorch#115012 Approved by: https://github.com/jansel ghstack dependencies: pytorch#115010, pytorch#115011
Stack from ghstack (oldest at bottom):
dict
in sorted key ordering #114947dict.copy()
/OrderedDict.copy()
/defaultdict.copy()
#115012dict.update(seq2)
/OrderedDict.update(seq2)
/defaultdict.update(seq2)
#115011dict.fromkeys()
/OrderedDict.fromkeys()
/defaultdict.fromkeys()
#115010cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng