Support `torch.concat` alias, add `cat` OpInfo & remove OpInfo test_out skips {cat...
authorAnirudh Dagar <anirudhdagar6@gmail.com>
Tue, 7 Sep 2021 06:55:53 +0000 (23:55 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 7 Sep 2021 06:57:18 +0000 (23:57 -0700)
commit1a1fb31cfa3135e56c533da037b5d8dc6981b7fa
tree9f7b575cc4b5bfb18ea4280772ede8481a8d513f
parent0a1aaff0dea5953928cefc506b4f4d39e0cb8a4d
Support `torch.concat` alias, add `cat` OpInfo & remove OpInfo test_out skips {cat, stack, hstack, vtack, dstack} (#62560)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/61767

## Changes

- [x] Add `torch.concat` alias to `torch.cat`
- [x] Add OpInfo for `cat`/`concat`
- [x] Fix `test_out` skips (Use `at::native::resize_output` or `at::native::resize_output_check`)
  - [x] `cat`/`concat`
  - [x] `stack`
  - [x] `hstack`
  - [x] `dstack`
  - [x] `vstack`/`row_stack`
- [x] Remove redundant tests for `cat`/`stack`

~I've not added `cat`/`concat` to OpInfo `op_db` yet, since cat is a little more tricky than other OpInfos (should have a lot of tests) and currently there are no OpInfos for that. I can try to add that in a subsequent PR or maybe here itself, whatever is suggested.~
**Edit**: cat/concat OpInfo has been added.

**Note**: I've added the named tensor support for `concat` alias as well, maybe that's out of spec in `array-api` but it is still useful for consistency in PyTorch.

Thanks to krshrimali for guidance on my first PR :))

cc mruberry rgommers pmeier asmeurer leofang AnirudhDagar asi1024 emcastillo kmaehashi heitorschueroff krshrimali

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62560

Reviewed By: saketh-are

Differential Revision: D30762069

Pulled By: mruberry

fbshipit-source-id: 6985159d1d9756238890488a0ab3ae7699d94337
15 files changed:
aten/src/ATen/core/aten_interned_strings.h
aten/src/ATen/core/interned_strings.h
aten/src/ATen/native/Resize.cpp
aten/src/ATen/native/Resize.h
aten/src/ATen/native/TensorShape.cpp
aten/src/ATen/native/cuda/Shape.cu
aten/src/ATen/native/native_functions.yaml
docs/source/torch.rst
test/test_autograd.py
test/test_fx_experimental.py
test/test_tensor_creation_ops.py
torch/_torch_docs.py
torch/csrc/jit/passes/normalize_ops.cpp
torch/overrides.py
torch/testing/_internal/common_methods_invocations.py