Repository: pytorch
Issue: pytorch tests failed
Labels: module: tests,triaged

## 🐛 Bug
compiled pytorch from source successfully, but some tests failed

## To Reproduce
After finish installing, run python testsrun_test.py, 5 tests failed
```
ERROR: test_cpp_frontend_module_has_same_output_as_python (__main__.TestCppExtensionJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_cpp_extensions_jit.py", line 467, in test_cpp_frontend_module_has_same_output_as_python
    extension = torch.utils.cpp_extension.load(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 965, in load
    return _jit_compile(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1192, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1542, in _import_module_from_library
    return imp.load_module(module_name, file, path, description)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: generic_type: type "Net" referenced unknown base type "torch::nn::Module"

======================================================================
ERROR: test_cpp_frontend_module_has_up_to_date_attributes (__main__.TestCppExtensionJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_cpp_extensions_jit.py", line 595, in test_cpp_frontend_module_has_up_to_date_attributes
    extension = torch.utils.cpp_extension.load(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 965, in load
    return _jit_compile(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1192, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1542, in _import_module_from_library
    return imp.load_module(module_name, file, path, description)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: generic_type: type "Net" referenced unknown base type "torch::nn::Module"

======================================================================
ERROR: test_cpp_frontend_module_python_inter_op (__main__.TestCppExtensionJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_cpp_extensions_jit.py", line 498, in test_cpp_frontend_module_python_inter_op
    extension = torch.utils.cpp_extension.load(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 965, in load
    return _jit_compile(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1192, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1542, in _import_module_from_library
    return imp.load_module(module_name, file, path, description)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: generic_type: type "Net" referenced unknown base type "torch::nn::Module"

======================================================================
ERROR: test_cpp_frontend_module_python_inter_op_with_cuda (__main__.TestCppExtensionJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_cpp_extensions_jit.py", line 617, in test_cpp_frontend_module_python_inter_op_with_cuda
    extension = torch.utils.cpp_extension.load(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 965, in load
    return _jit_compile(
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1192, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/home/bernard/opt/python38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1542, in _import_module_from_library
    return imp.load_module(module_name, file, path, description)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/bernard/opt/python38/lib/python3.8/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: generic_type: type "Net" referenced unknown base type "torch::nn::Module"

======================================================================
ERROR: test_warning (__main__.TestCppExtensionJIT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_cpp_extensions_jit.py", line 749, in test_warning
    warn_mod.foo(t, 1)
RuntimeError: Error with CPUDoubleType

----------------------------------------------------------------------
Ran 23 tests in 220.052s

FAILED (errors=5)
Traceback (most recent call last):
  File "run_test.py", line 752, in <module>
    main()
  File "run_test.py", line 741, in main
    raise RuntimeError(err)
RuntimeError: test_cpp_extensions_jit failed!
```
## Environment

 - PyTorch Version: 1.7.0a0+4cdbe5c
 - OS (e.g., Linux): Ubuntu Linux
 - How you installed PyTorch (`conda`, `pip`, source): source
 - Build command you used (if compiling from source): 

```
export BUILD_ONNX_PYTHON=1 USE_CUDA=1 USE_CUDNN=1 USE_MKLDNN=1 USE_TENSORRT=1 USE_OPENCV=1 USE_FFMPEG=1 USE_LMDB=1

python setup.py build

python setup.py install 
```
In my setup, python = python3

 - Python version: 3.8.5
 - CUDA/cuDNN version:CUDA10.0, CUDNN7.6.5.32.1
 - GPU models and configuration: GTX1070 
 


cc @mruberry @VitalyFedyunin