-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Get rid of type() method on TensorOptions; use at::getType instead #11023
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
Conversation
Differential Revision: D9562467 Differential Version: 56443875
(This doesn't compile yet) |
function_name, | ||
" is not implemented for sparse types, got: ", | ||
options.type().toString()); | ||
at::getType(options).toString()); |
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.
|
||
Tensor eye(int64_t n, int64_t m, const TensorOptions& options) { | ||
auto tensor = options.type().tensor({}); | ||
auto tensor = at::getType(options).tensor({}); |
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.
Differential Revision: D9562467 Differential Version: 56445436
Differential Revision: D9562467 Differential Version: 56447016
Differential Revision: D9562467 Differential Version: 56447216
@pytorchbot retest this please |
1 similar comment
@pytorchbot retest this please |
Differential Revision: D9562467 Differential Version: 56473044
aten/src/ATen/TensorOptions.h
Outdated
} | ||
DeviceGuard guard(options.device()); | ||
return options.type().copy(tensor, non_blocking); | ||
return at::getType(options).copy(tensor, non_blocking); |
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.
function_name, | ||
" expects floating point dtypes, got: ", | ||
options.type().toString()); | ||
at::getType(options).toString()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted, but please work through comments first
Differential Revision: D9562467 Differential Version: 56608519
Differential Revision: D9562467 Differential Version: 56650790
Differential Revision: D9562467 Differential Version: 56651350
Differential Revision: D9562467 Differential Version: 56652506
Differential Revision: D9562467 Differential Version: 56672440
…11023) Summary: Pull Request resolved: pytorch/pytorch#11023 I'd like TensorOptions to not know anything about Context, so I can move it to ATen/core without pulling in Context. To do this, the type() method has to go, since it consults the context to get a Type. Reviewed By: cpuhrsch Differential Revision: D9562467 fbshipit-source-id: 61a18a76eb042a5e70b64b963501e9d68c25d4f0
…ytorch#11023) Summary: Pull Request resolved: pytorch#11023 I'd like TensorOptions to not know anything about Context, so I can move it to ATen/core without pulling in Context. To do this, the type() method has to go, since it consults the context to get a Type. Reviewed By: cpuhrsch Differential Revision: D9562467 fbshipit-source-id: 61a18a76eb042a5e70b64b963501e9d68c25d4f0
Get rid of type() method on TensorOptions; use at::getType instead
I'd like TensorOptions to not know anything about Context, so I can
move it to ATen/core without pulling in Context. To do this, the
type() method has to go, since it consults the context to get a Type.
Differential Revision: D9562467
Stacked on #11145