Unverified Commit 498505ba authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Doc] fix docserver build for tutorials (#2518)

* fix doc build

* hide GPU code
parent 5d4995e6
...@@ -29,12 +29,20 @@ pytorch: ...@@ -29,12 +29,20 @@ pytorch:
@echo "##################################################################" @echo "##################################################################"
@DGLBACKEND=pytorch DGL_LOADALL=true $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @DGLBACKEND=pytorch DGL_LOADALL=true $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
tensorflow:
@echo "##################################################################"
@echo "# #"
@echo "# Step 3: Building Tensorflow tutorials #"
@echo "# #"
@echo "##################################################################"
@DGLBACKEND=tensorflow DGL_LOADALL=true $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
html-noexec: html-noexec:
DGL_LOADALL=true $(SPHINXBUILD) -D plot_gallery=0 -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" DGL_LOADALL=true $(SPHINXBUILD) -D plot_gallery=0 -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"
@echo @echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
html: Makefile mxnet pytorch html: Makefile mxnet pytorch tensorflow
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
......
...@@ -192,10 +192,12 @@ train(g, model) ...@@ -192,10 +192,12 @@ train(g, model)
# Training on GPU requires to put both the model and the graph onto GPU # Training on GPU requires to put both the model and the graph onto GPU
# with the ``to`` method, similar to what you will do in PyTorch. # with the ``to`` method, similar to what you will do in PyTorch.
# #
# .. code:: python
g = g.to('cuda') #
model = GCN(g.ndata['feat'].shape[1], 16, dataset.num_classes).to('cuda') # g = g.to('cuda')
train(g, model) # model = GCN(g.ndata['feat'].shape[1], 16, dataset.num_classes).to('cuda')
# train(g, model)
#
###################################################################### ######################################################################
......
...@@ -25,12 +25,4 @@ def _load_backend(mod_name): ...@@ -25,12 +25,4 @@ def _load_backend(mod_name):
for api, obj in mod.__dict__.items(): for api, obj in mod.__dict__.items():
setattr(thismod, api, obj) setattr(thismod, api, obj)
_load_backend(backend_name)
LOAD_ALL = os.getenv("DGL_LOADALL", "False")
if LOAD_ALL.lower() != "false":
from .mxnet import *
from .pytorch import *
from .tensorflow import *
else:
_load_backend(backend_name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment