Eliminate use of getType from DLConvertor#11080
Closed
ezyang wants to merge 4 commits intoexport-D9578399from
Closed
Eliminate use of getType from DLConvertor#11080ezyang wants to merge 4 commits intoexport-D9578399from
ezyang wants to merge 4 commits intoexport-D9578399from
Conversation
Differential Revision: D9578734 Differential Version: 56519039
Differential Revision: D9578734 Differential Version: 56520207
Differential Revision: D9578734 Differential Version: 56526151
Differential Revision: D9578734 Differential Version: 56530959
cpuhrsch
reviewed
Aug 30, 2018
| throw std::logic_error("Unsupported device_type: " + std::to_string(ctx.device_type)); | ||
| } | ||
| return backend; | ||
| return DeviceType::CPU; // impossible |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
cpuhrsch
reviewed
Aug 30, 2018
| return options.type().tensorFromBlob(data, sizes, deleter); | ||
| } | ||
|
|
||
| inline Tensor from_blob( |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
gchanan
approved these changes
Aug 31, 2018
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Aug 31, 2018
Summary: Pull Request resolved: pytorch/pytorch#11080 - Add a new TensorOptions(Device, ScalarType) constructor, which serves roughly the same role as getType used to. We shouldn't get too wild with these constructors, but since this particular one was widely used by getType, it seems worth adding. - Change DLPack DeviceType conversion to at::DeviceType, rather than at::Backend. While I'm at, add a few more conversions that at::DeviceType understands. - Add a new overload of from_blob which understands strides. Reviewed By: gchanan, cpuhrsch Differential Revision: D9578734 fbshipit-source-id: 28288ec053aae8765e23925ab91023398d632d6b
PenghuiCheng
pushed a commit
to PenghuiCheng/pytorch
that referenced
this pull request
Sep 11, 2018
Summary: Pull Request resolved: pytorch#11080 - Add a new TensorOptions(Device, ScalarType) constructor, which serves roughly the same role as getType used to. We shouldn't get too wild with these constructors, but since this particular one was widely used by getType, it seems worth adding. - Change DLPack DeviceType conversion to at::DeviceType, rather than at::Backend. While I'm at, add a few more conversions that at::DeviceType understands. - Add a new overload of from_blob which understands strides. Reviewed By: gchanan, cpuhrsch Differential Revision: D9578734 fbshipit-source-id: 28288ec053aae8765e23925ab91023398d632d6b
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
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.
Eliminate use of getType from DLConvertor
which serves roughly the same role as getType used to.
We shouldn't get too wild with these constructors, but
since this particular one was widely used by getType,
it seems worth adding.
rather than at::Backend. While I'm at, add a few more
conversions that at::DeviceType understands.
Differential Revision: D9578734
Stacked on #11078