Repository: pytorch
Issue: Operation Registration Error
Labels: triaged,module: dispatch

## 🐛 Bug
<!-- A clear and concise description of what the bug is. -->
Issue with operator registration in aten.

## To Reproduce

Steps to reproduce the behavior:
I am attempting to follow the tutorial here: https://pytorch.org/tutorials/advanced/torch_script_custom_ops.html

The following line is causing a compilation error on 1.4 that did not occur on 1.1.
static auto registry =
  torch::RegisterOperators("my_ops::warp_perspective", &warp_perspective);


<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->
```
[1/2] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=correlate -DTORCH_API_INCLUDE_EXTENSION_H -isystem /usr/local/lib/python3.6/dist-packages/torch/include -isystem /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -isystem /usr/local/lib/python3.6/dist-packages/torch/include/TH -isystem /usr/local/lib/python3.6/dist-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /usr/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' -std=c++11 -c /workspace/second.pytorch/second/pytorch/models/correlate.cu -o correlate.cuda.o
FAILED: correlate.cuda.o 
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=correlate -DTORCH_API_INCLUDE_EXTENSION_H -isystem /usr/local/lib/python3.6/dist-packages/torch/include -isystem /usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -isystem /usr/local/lib/python3.6/dist-packages/torch/include/TH -isystem /usr/local/lib/python3.6/dist-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /usr/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_70,code=sm_70 --compiler-options '-fPIC' -std=c++11 -c /workspace/second.pytorch/second/pytorch/models/correlate.cu -o correlate.cuda.o
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/ivalue_inl.h(837): error: static assertion failed with "You are calling from with a type that it doesn't support, and isn't a potential custom class (ie: is an intrusive_ptr)"
          detected during:
            instantiation of "c10::IValue c10::ivalue::detail::from_(T, std::false_type) [with T=at::Tensor]" 
(844): here
            instantiation of "c10::IValue c10::ivalue::from(T) [with T=at::Tensor]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/boxing/kernel_functor.h(184): here
            instantiation of "c10::IValue c10::detail::return_to_ivalue<T,AllowDeprecatedTypes>(T &&) [with T=at::Tensor, AllowDeprecatedTypes=true]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/boxing/kernel_functor.h(208): here
            instantiation of "void c10::detail::push_outputs<OutputType, AllowDeprecatedTypes>::call(OutputType &&, c10::Stack *) [with OutputType=at::Tensor, AllowDeprecatedTypes=true]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/boxing/kernel_functor.h(236): here
            instantiation of "void c10::detail::wrap_kernel_functor_boxed<KernelFunctor, AllowDeprecatedTypes, c10::guts::enable_if_t<<expression>, void>>::call(c10::OperatorKernel *, c10::Stack *) [with KernelFunctor=c10::detail::WrapRuntimeKernelFunctor<c10::guts::decay_t<at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t)>>, AllowDeprecatedTypes=true]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/boxing/KernelFunction.h(172): here
            instantiation of "c10::KernelFunction c10::KernelFunction::makeFromUnboxedFunctor<AllowLegacyTypes,KernelFunctor>(std::unique_ptr<c10::OperatorKernel, std::default_delete<c10::OperatorKernel>>) [with AllowLegacyTypes=true, KernelFunctor=c10::detail::WrapRuntimeKernelFunctor<c10::guts::decay_t<at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t)>>]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/boxing/KernelFunction.h(315): here
            instantiation of "c10::KernelFunction c10::KernelFunction::makeFromUnboxedRuntimeFunction(FuncType *) [with AllowLegacyTypes=true, FuncType=at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t)]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/op_registration/op_registration.h(517): here
            instantiation of "c10::guts::enable_if_t<<expression>, c10::RegisterOperators &&> c10::RegisterOperators::op(const std::string &, FuncType *, c10::RegisterOperators::Options &&) && [with FuncType=at::Tensor (const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t)]" 
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/op_registration/op_registration.h(474): here
            instantiation of "c10::RegisterOperators::RegisterOperators(const std::string &, FuncType &&, c10::RegisterOperators::Options &&) [with FuncType=at::Tensor (*)(const at::Tensor &, const at::Tensor &, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t)]" 
/workspace/second.pytorch/second/pytorch/models/correlate.cu(135): here
```
## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

 - PyTorch Version (e.g., 1.0): 1.4
 - OS (e.g., Linux): Linux Ubuntu 16.04
 - How you installed PyTorch (`conda`, `pip`, source): Pip from homepage
 - Build command you used (if compiling from source):
 - Python version: 3.6
 - CUDA/cuDNN version: 10.1
 - GPU models and configuration:
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->