Repository: pytorch
Issue: Could not find any similar ops to "foo..." in the `Libtorch`
Labels: triage review,oncall: jit,triaged

## 🐛 Bug
I want to make the `jit trace` model in the Python and forwarding tensors in the C++.

In cpp, got error.
```
terminate called after throwing an instance of 'torch::jit::script::ErrorReport'
  what():  
Unknown builtin op: tomo::morph_pool.
Could not find any similar ops to tomo::morph_pool. This op may not exist or may not be currently supported in TorchScript.

....

Serialized   File "code/__torch__/torch/nn/modules/module/___torch_mangle_162.py", line 9
    argument_1: Tensor) -> Tensor:
    _0 = self.morph
    x_min_morph = ops.tomo.morph_pool(argument_1, _0)
                  ~~~~~~~~~~~~~~~~~~~ <--- HERE
    x, _1 = torch.min(x_min_morph, 2, False)
    x_max_morph = ops.tomo.morph_pool(x, _0)

[1]    57316 abort (core dumped)  ./forward 
```

But In the python, working well as I expected
![image](https://user-images.githubusercontent.com/18730255/77829186-c2ac6380-7163-11ea-8a0d-8eba35822861.png)

## To Reproduce

Now I'm using custom library like the `torchvision`

I had assign function like under codes.
```
static auto registry =
  torch::RegisterOperators()
         .op("tomo::morph_pool", &morph_pool)
         .op("tomo::roi_pool_3d", &roi_pool_3d)
         .op("tomo::roi_align_3d", &roi_align_3d)
         .op("tomo::nms_3d", &nms_3d);
```

And in the `setup.py`
```
def get_extensions():
    this_dir = os.path.dirname(os.path.abspath(__file__))
    extensions_dir = os.path.join(this_dir, "csrc")

    main_file = [os.path.join(extensions_dir, "vision.cpp")]
    source_cpu = glob.glob(os.path.join(extensions_dir, "**", "*.cpp"))
    source_cuda = glob.glob(os.path.join(extensions_dir, "**", "*.cu"))

    sources = main_file + source_cpu
    extension = CppExtension

    extra_compile_args = {"cxx": []}
    define_macros = []

    if (torch.cuda.is_available() and CUDA_HOME is not None) or os.getenv("FORCE_CUDA", "0") == "1":
        extension = CUDAExtension
        sources += source_cuda
        define_macros += [("WITH_CUDA", None)]
        extra_compile_args["nvcc"] = [
            "-DCUDA_HAS_FP16=1",
            "-D__CUDA_NO_HALF_OPERATORS__",
            "-D__CUDA_NO_HALF_CONVERSIONS__",
            "-D__CUDA_NO_HALF2_OPERATORS__",
        ]

        # It's better if pytorch can do this by default ..
        CC = os.environ.get("CC", None)
        if CC is not None:
            extra_compile_args["nvcc"].append("-ccbin={}".format(CC))

    include_dirs = [extensions_dir]

    ext_modules = [
        extension(
            "tomo._C",
            sources,
            include_dirs=include_dirs,
            define_macros=define_macros,
            extra_compile_args=extra_compile_args,
        )
    ]

    return ext_modules

cmdclass={"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}
```

## Environment

I was trying to 2 versions of libtorch
`1.4.0` and the latest
```
➜ cat libtorch/build-version
1.6.0.dev20200328+cu101
```

```
Collecting environment information...
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 16.04.6 LTS
GCC version: (Ubuntu 8.3.0-16ubuntu3~16.04) 8.3.0
CMake version: version 3.11.0

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.1.243
GPU models and configuration: 
GPU 0: Tesla V100-SXM2-32GB
GPU 1: Tesla V100-SXM2-32GB
GPU 2: Tesla V100-SXM2-32GB
GPU 3: Tesla V100-SXM2-32GB

Nvidia driver version: 418.87.01
cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7.6.4

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] pytorch-sphinx-theme==0.0.24
[pip3] torch==1.4.0
[pip3] torchsummary==1.5.1
[pip3] torchvision==0.5.0
[conda] Could not collect
```



## Additional context

<!-- Add any other context about the problem here. -->


cc @suo