[TENSOR MERGE] Reimplement localScalar as a native function.#9762
[TENSOR MERGE] Reimplement localScalar as a native function.#9762ezyang wants to merge 4 commits intopytorch:masterfrom
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
I split it into two parts, _local_scalar and _local_scalar_dense (unchecked) so I could reuse the sparse logic in both paths. _local_scalar became a method on Tensor to work around a circular include problem. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
e40d297 to
335ea05
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
aten/src/ATen/native/README.md
Outdated
| cpu_half: True | ||
| ``` | ||
|
|
||
| By default, we do not generate dispatch for CPU half, because most kernels will |
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.
|
|
||
| # NB: Does NOT check precondition that numel == 1 | ||
| - func: _local_scalar_dense(Tensor self) -> Scalar | ||
| cpu_half: True |
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.
| namespace at { | ||
| namespace native { | ||
|
|
||
| Scalar _local_scalar(const Tensor& self) { |
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.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
|
@pytorchbot retest this please |
2 similar comments
|
@pytorchbot retest this please |
|
@pytorchbot retest this please |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: I split it into two parts, _local_scalar and _local_scalar_dense (unchecked) so I could reuse the sparse logic in both paths. _local_scalar became a method on Tensor to work around a circular include problem. This is resurrected copy of #9652 Pull Request resolved: pytorch/pytorch#9762 Differential Revision: D8972348 Pulled By: ezyang fbshipit-source-id: 2232dbfc8e1286b8a4a1c67d285c13a7771aad4c
Summary: I split it into two parts, _local_scalar and _local_scalar_dense (unchecked) so I could reuse the sparse logic in both paths. _local_scalar became a method on Tensor to work around a circular include problem. This is resurrected copy of pytorch#9652 Pull Request resolved: pytorch#9762 Differential Revision: D8972348 Pulled By: ezyang fbshipit-source-id: 2232dbfc8e1286b8a4a1c67d285c13a7771aad4c
Summary: I split it into two parts, _local_scalar and _local_scalar_dense (unchecked) so I could reuse the sparse logic in both paths. _local_scalar became a method on Tensor to work around a circular include problem. This is resurrected copy of pytorch#9652 Pull Request resolved: pytorch#9762 Differential Revision: D8972348 Pulled By: ezyang fbshipit-source-id: 2232dbfc8e1286b8a4a1c67d285c13a7771aad4c
I split it into two parts, _local_scalar and _local_scalar_dense (unchecked)
so I could reuse the sparse logic in both paths.
_local_scalar became a method on Tensor to work around a circular
include problem.
This is resurrected copy of #9652