Skip to content

Update how we input kwargs #314

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

Closed
wants to merge 1 commit into from
Closed

Conversation

angelayi
Copy link
Contributor

Summary:
Previously, the code for passing inputs to exported program was:

if kwargs:
    return (args, kwargs)
else:
    return args

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng

X-link: pytorch/pytorch#109160

Differential Revision: D49218534

Pulled By: angelayi

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 13, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 13, 2023
Summary:
X-link: pytorch/executorch#314

Previously, the code for passing inputs to exported program was:
```
if kwargs:
    return (args, kwargs)
else:
    return args
```

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng


Differential Revision: D49218534

Pulled By: angelayi
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 15, 2023
Summary:
X-link: pytorch/executorch#314

Previously, the code for passing inputs to exported program was:
```
if kwargs:
    return (args, kwargs)
else:
    return args
```

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng


Reviewed By: zhxchen17

Differential Revision: D49218534

Pulled By: angelayi
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

@angelayi angelayi force-pushed the export-D49218534 branch 2 times, most recently from 2c8dc34 to 02b0b9e Compare September 15, 2023 21:06
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 15, 2023
Summary:
X-link: pytorch/executorch#314

Previously, the code for passing inputs to exported program was:
```
if kwargs:
    return (args, kwargs)
else:
    return args
```

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng


Reviewed By: zhxchen17

Differential Revision: D49218534

Pulled By: angelayi
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Sep 18, 2023
Summary:
X-link: pytorch/executorch#314

Previously, the code for passing inputs to exported program was:
```
if kwargs:
    return (args, kwargs)
else:
    return args
```

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng


Reviewed By: zhxchen17

Differential Revision: D49218534

Pulled By: angelayi
Summary:

Previously, the code for passing inputs to exported program was:
```
if kwargs:
    return (args, kwargs)
else:
    return args
```

However, this causes some inconsistency where if the original input contains args and kwargs, the treespec would be a tuple containing a tuple of arguments, and a dictionary of keyword arguments. But if the original input only contained args, the treespec would just be a tuple of arguments.

So I updated the code to just always keep the kwargs around

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx chenyang78 aakhundov kadeng

X-link: pytorch/pytorch#109160

Reviewed By: zhxchen17

Differential Revision: D49218534

Pulled By: angelayi
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49218534

@facebook-github-bot
Copy link
Contributor

@angelayi merged this pull request in 49d2e68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants