Skip to content

[PyTorch] Fix return value of IValue::to for Tensor/String#51463

Closed
swolchok wants to merge 4 commits intogh/swolchok/109/basefrom
gh/swolchok/109/head
Closed

[PyTorch] Fix return value of IValue::to for Tensor/String#51463
swolchok wants to merge 4 commits intogh/swolchok/109/basefrom
gh/swolchok/109/head

Conversation

@swolchok
Copy link
Copy Markdown
Contributor

@swolchok swolchok commented Feb 1, 2021

Stack from ghstack:

We can make the return type of the to() template match the return type of toFoo() by using the same technique we use for list_element_to_const_ref. Also simplifies list_element_to_const_ref.

Differential Revision: D26163848

We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.

Differential Revision: [D26163848](https://our.internmc.facebook.com/intern/diff/D26163848/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Feb 1, 2021

💊 CI failures summary and remediations

As of commit 16f796e (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.

Differential Revision: [D26163848](https://our.internmc.facebook.com/intern/diff/D26163848/)

[ghstack-poisoned]
We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.

Differential Revision: [D26163848](https://our.internmc.facebook.com/intern/diff/D26163848/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Feb 9, 2021
Pull Request resolved: #51463

We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.
ghstack-source-id: 121298431

Differential Revision: [D26163848](https://our.internmc.facebook.com/intern/diff/D26163848/)
We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.

Differential Revision: [D26163848](https://our.internmc.facebook.com/intern/diff/D26163848/)

[ghstack-poisoned]
Copy link
Copy Markdown

@bhosmer bhosmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - I was trying to come up with alternative names like ivalue_to_const_ref_if_possible etc. but I couldn't come up with a clear enough winner to make it worth another round of edits. (although if there were, we could use the same suffix on list_element_to for consistency)

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in b2aa63f.

@facebook-github-bot facebook-github-bot deleted the gh/swolchok/109/head branch February 21, 2021 15:16
xsacha pushed a commit to xsacha/pytorch that referenced this pull request Mar 31, 2021
…1463)

Summary:
Pull Request resolved: pytorch#51463

We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.
ghstack-source-id: 121363468

Test Plan:
CI

built and ran AdIndexer benchmark w/ batch size 1 under perf stat
--repeat 5 to make sure it didn't regress

Reviewed By: bhosmer

Differential Revision: D26163848

fbshipit-source-id: b8563263b9f9fa5311c7d7cedc89e28bc5badda0
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…1463)

Summary:
Pull Request resolved: pytorch#51463

We can make the return type of the `to()` template match the return type of toFoo() by using the same technique we use for `list_element_to_const_ref`. Also simplifies `list_element_to_const_ref`.
ghstack-source-id: 121363468

Test Plan:
CI

built and ran AdIndexer benchmark w/ batch size 1 under perf stat
--repeat 5 to make sure it didn't regress

Reviewed By: bhosmer

Differential Revision: D26163848

fbshipit-source-id: b8563263b9f9fa5311c7d7cedc89e28bc5badda0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants