Fix split_size test failures#11051
Fix split_size test failures#11051driazati wants to merge 2 commits intopytorch:masterfrom driazati:split_size
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@driazati We separated |
|
@pytorchbot retest this please |
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
| namespace { | ||
| RegisterOperators reg({ | ||
| Operator( | ||
| "aten::split(Tensor self, int[] split_sizes, int dim=0) -> 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.
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.
| Operator( | ||
| "aten::Size(int[] split_sizes) -> int[]", | ||
| [](Stack& stack) { | ||
| auto result = (std::move(peek(stack, 0, 1))).toIntList()->elements(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| namespace { | ||
| RegisterOperators reg({ | ||
| Operator( | ||
| "aten::split(Tensor self, int[] split_sizes, int dim=0) -> Tensor[]", |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
facebook-github-bot
left a comment
There was a problem hiding this comment.
driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| return 0; | ||
| }), | ||
| Operator( | ||
| "aten::Size(int[] sizes) -> int[]", |
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.
Summary: ~~This PR fixes pytorch#8525 by renaming `split_with_sizes` to `split` so that 2 `aten::split` ops are generated (previously `aten::split(self, int, int)` and `aten::split_with_sizes(self, int[], int)` were generated)~~ ~~`split_with_sizes` was made in PR pytorch#5443, but I don't see a reason for it to have a different name than `split` rather than just overload `split`.~~ This PR fixes pytorch#8525 by adding `register_special_ops.cpp` to mirror Python dispatching from `split` to `split` and `split_with_sizes` in [tensor.py](https://github.com/pytorch/pytorch/blob/master/torch/tensor.py#L279). It also fixes pytorch#8520 by adding an `int[]` wherever it sees `torch.Size` In a follow up PR this could also be used to fix some of the other `unknown builtin op` test errors. Pull Request resolved: pytorch#11051 Differential Revision: D9582443 Pulled By: driazati fbshipit-source-id: d27201f85937d72e45e851eaa1460dd3dd1b61a9
This PR fixes #8525 by renamingsplit_with_sizestosplitso that 2aten::splitops aregenerated (previously
aten::split(self, int, int)andaten::split_with_sizes(self, int[], int)were generated)split_with_sizeswas made in PR #5443, but I don't see a reason for it to havea different name than
splitrather than just overloadsplit.This PR fixes #8525 by adding
register_special_ops.cppto mirror Python dispatching fromsplittosplitandsplit_with_sizesin tensor.py.It also fixes #8520 by adding an
int[]wherever it seestorch.SizeIn a follow up PR this could also be used to fix some of the other
unknown builtin optest errors.