Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
498505ba
Unverified
Commit
498505ba
authored
Jan 12, 2021
by
Quan (Andy) Gan
Committed by
GitHub
Jan 12, 2021
Browse files
[Doc] fix docserver build for tutorials (#2518)
* fix doc build * hide GPU code
parent
5d4995e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
docs/Makefile
docs/Makefile
+9
-1
new-tutorial/1_introduction.py
new-tutorial/1_introduction.py
+6
-4
python/dgl/nn/__init__.py
python/dgl/nn/__init__.py
+1
-9
No files found.
docs/Makefile
View file @
498505ba
...
@@ -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).
...
...
new-tutorial/1_introduction.py
View file @
498505ba
...
@@ -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)
#
######################################################################
######################################################################
...
...
python/dgl/nn/__init__.py
View file @
498505ba
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment