-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Move type casting to c10/util/TypeCast.h #28426
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Oct 22, 2019
Closed
Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. [ghstack-poisoned]
Collaborator
Author
ezyang
approved these changes
Oct 22, 2019
Contributor
|
I'm going to wait on reviews for the next diff in the stack before landing this, if you don't mind |
Collaborator
Author
|
@ezyang That works for me. |
Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. [ghstack-poisoned]
Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. [ghstack-poisoned]
Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. [ghstack-poisoned]
Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. [ghstack-poisoned]
Collaborator
Author
|
@ezyang The tensoriterator PR has been approved, and this could be landed now. |
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Oct 28, 2019
Summary: Pull Request resolved: pytorch/pytorch#28426 Type casting is used in copy, and will be used also in tensor iterator in the next stacked diff. I move it to c10 to make it serve as an common util for different things. I also add two dynamic casting functions - fetch_and_cast - cast_and_store fetch_and_cast fetch a value with dynamic type specified by a ScalarType from a void pointer and cast it to a static type. cast_and_store casts a static typed value into dynamic type specified by a ScalarType, and store it into a void pointer. Test Plan: Imported from OSS Differential Revision: D18170996 Pulled By: ezyang fbshipit-source-id: 41658afd5c0ab58c6b6c510424893d9a2a0c059e
Contributor
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Nov 5, 2019
Summary: ezyang This brings back the stack pytorch/pytorch#28426 with hopefully windows build fixed. Let's wait for the CI to see what happens. Pull Request resolved: pytorch/pytorch#28843 Differential Revision: D18224616 Pulled By: ezyang fbshipit-source-id: e13051e9ff9cb8d437a733b2c89b4172a379cafc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Type casting is used in copy, and will be used also in tensor iterator
in the next stacked diff. I move it to c10 to make it serve as an common
util for different things.
I also add two dynamic casting functions
fetch_and_cast fetch a value with dynamic type specified by a ScalarType
from a void pointer and cast it to a static type.
cast_and_store casts a static typed value into dynamic type specified
by a ScalarType, and store it into a void pointer.
Differential Revision: D18170996