Repository: pytorch
Issue: `test_variant_consistency_jit` failing for `max_unpool2d`
Labels: oncall: jit

## 🐛 Bug

While trying to add OpInfo for `max_unpool2d`, following error is raised:

```python
======================================================================
ERROR: test_variant_consistency_jit_nn_functional_max_unpool2d_cpu_float32 (__main__.TestJitCPU)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/krshrimali/Documents/Projects/Quansight/pytorch/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
    raise rte
  File "/home/krshrimali/Documents/Projects/Quansight/pytorch/torch/testing/_internal/common_device_type.py", line 371, in instantiated_test
    result = test(self, **param_kwargs)
  File "/home/krshrimali/Documents/Projects/Quansight/pytorch/torch/testing/_internal/common_device_type.py", line 737, in test_wrapper
    return test(*args, **kwargs)
  File "/home/krshrimali/Documents/Projects/Quansight/pytorch/test/test_ops.py", line 800, in test_variant_consistency_jit
    check_alias_annotation(name, (get_sample(),) + sample.args, sample.kwargs,
  File "/home/krshrimali/Documents/Projects/Quansight/pytorch/torch/testing/_internal/jit_metaprogramming_utils.py", line 524, in check_alias_annotation
    torch._C._jit_check_alias_annotation(CU.the_method.graph, tuple(tensors), aten_name)
RuntimeError: There should be exactly two elements (height, width) in output_size, but found: 0 elements.

----------------------------------------------------------------------
```

This happens when `output_size` is not passed to the kwargs in sample inputs. Please note that on `cuda` device, it instead leads to a segmentation fault. 

## To Reproduce

Steps to reproduce the behavior:

1. Checkout to the branch: https://github.com/krshrimali/pytorch/tree/origin/max_unpoolNd
2. Run the OpInfo tests after removing the skips for `max_unpool2d`. `python3 test/test_ops.py -k max_unpool2d`

As mentioned earlier, on my local system (CUDA), I get segmentation fault, so I had to add a skip for CUDA for this test to see the above failure on CPU:

```python
DecorateInfo(unittest.skip("Skipped!"), 'TestJit', 'test_variant_consistency_jit', device_type='cuda', dtypes=(torch.float32,)),
```

If anyone else can reproduce this segmentation fault, please let me know.

## Expected behavior

The test should pass.

## Environment

```
Collecting environment information...
PyTorch version: 1.11.0a0+git2ebe072
Is debug build: False
CUDA used to build PyTorch: 11.0
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.2 LTS (x86_64)
GCC version: (GCC) 9.4.0
Clang version: Could not collect
CMake version: version 3.21.3
Libc version: glibc-2.31

Python version: 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:23:11)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.4.0-89-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.0.221
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 2060
GPU 1: NVIDIA GeForce RTX 2060

Nvidia driver version: 465.19.01
cuDNN version: Probably one of the following:
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-10.1.243/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-10.2.89/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.4.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] mypy==0.812
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.2
[pip3] torch==1.11.0a0+git6649b1a
[pip3] torchvision==0.12.0a0+e32f543
[conda] magma-cuda110             2.5.2                         1    pytorch
[conda] mkl                       2021.4.0           h8d4b97c_729    conda-forge
[conda] mkl-include               2021.4.0           h8d4b97c_729    conda-forge
[conda] mypy                      0.812            py39h3811e60_2    conda-forge
[conda] mypy_extensions           0.4.3            py39hf3d152e_3    conda-forge
[conda] numpy                     1.21.2           py39hdbf815f_0    conda-forge
[conda] torch                     1.11.0a0+git6649b1a           dev_0    <develop>
[conda] torchvision               0.12.0a0+e32f543          pypi_0    pypi
```

## Additional context

Please see https://github.com/pytorch/pytorch/pull/67328 for the OpInfo PR.

cc: @mruberry @eellison