Skip to content

Conversation

@zasdfgbnm
Copy link
Collaborator

@zasdfgbnm zasdfgbnm commented Oct 22, 2019

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
  • 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.

Differential Revision: D18170996

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]
@zasdfgbnm zasdfgbnm requested a review from ezyang October 22, 2019 17:38
@zasdfgbnm
Copy link
Collaborator Author

zasdfgbnm commented Oct 22, 2019

@ezyang Sorry I messed up with #28343, so I resubmit it here. I have added the comment, so it should be fine.

@ezyang
Copy link
Contributor

ezyang commented Oct 22, 2019

I'm going to wait on reviews for the next diff in the stack before landing this, if you don't mind

@zasdfgbnm
Copy link
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]
@zasdfgbnm
Copy link
Collaborator Author

zasdfgbnm commented Oct 25, 2019

@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
@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in 688a9db.

@zasdfgbnm zasdfgbnm deleted the gh/zasdfgbnm/11/head branch October 29, 2019 04:13
@zasdfgbnm zasdfgbnm restored the gh/zasdfgbnm/11/head branch October 29, 2019 17:45
@zasdfgbnm zasdfgbnm reopened this Oct 29, 2019
@zasdfgbnm zasdfgbnm closed this Oct 29, 2019
@facebook-github-bot facebook-github-bot deleted the gh/zasdfgbnm/11/head branch November 2, 2019 14:17
facebook-github-bot pushed a commit that referenced this pull request Nov 5, 2019
Summary:
ezyang This brings back the stack #28426 with hopefully windows build fixed. Let's wait for the CI to see what happens.
Pull Request resolved: #28843

Differential Revision: D18224616

Pulled By: ezyang

fbshipit-source-id: e13051e9ff9cb8d437a733b2c89b4172a379cafc
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants