Skip to content

Commit

Permalink
Try mock imports for Torch to build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jachiam committed Jan 30, 2020
1 parent c1a12c4 commit 023fd73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
sys.path.insert(0, dirname(dirname(__file__)))

# Mock mpi4py to get around having to install it on RTD server (which fails)
# Also to mock PyTorch, because it is too large for the RTD server to download
from unittest.mock import MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()

MOCK_MODULES = ['mpi4py']
MOCK_MODULES = ['mpi4py', 'torch']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# Finish imports
Expand Down
1 change: 0 additions & 1 deletion docs/docs_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ sphinx==1.5.6
sphinx-autobuild==0.7.1
sphinx-rtd-theme==0.4.1
tensorflow>=1.8.0,<2.0
torch==1.3.1
tqdm

0 comments on commit 023fd73

Please sign in to comment.