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
7e0893e6
Unverified
Commit
7e0893e6
authored
Apr 02, 2020
by
Jinjing Zhou
Committed by
GitHub
Apr 02, 2020
Browse files
[Docs] Fix doc build doesn't work for nn.tensorflow and nn.mxnet (#1413)
* fix * lint * fix
parent
31a636a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
docs/Makefile
docs/Makefile
+3
-3
python/dgl/nn/__init__.py
python/dgl/nn/__init__.py
+10
-1
No files found.
docs/Makefile
View file @
7e0893e6
...
@@ -19,7 +19,7 @@ mxnet:
...
@@ -19,7 +19,7 @@ mxnet:
@
echo
"# Step 1: Building MXNet tutorials #"
@
echo
"# Step 1: Building MXNet tutorials #"
@
echo
"# #"
@
echo
"# #"
@
echo
"##################################################################"
@
echo
"##################################################################"
@
DGLBACKEND
=
mxnet
$(SPHINXBUILD)
-M
html
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
@
DGLBACKEND
=
mxnet
DGL_LOADALL
=
true
$(SPHINXBUILD)
-M
html
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
pytorch
:
pytorch
:
@
echo
"##################################################################"
@
echo
"##################################################################"
...
@@ -27,10 +27,10 @@ pytorch:
...
@@ -27,10 +27,10 @@ pytorch:
@
echo
"# Step 2: Building PyTorch tutorials #"
@
echo
"# Step 2: Building PyTorch tutorials #"
@
echo
"# #"
@
echo
"# #"
@
echo
"##################################################################"
@
echo
"##################################################################"
@
DGLBACKEND
=
pytorch
$(SPHINXBUILD)
-M
html
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
@
DGLBACKEND
=
pytorch
DGL_LOADALL
=
true
$(SPHINXBUILD)
-M
html
"
$(SOURCEDIR)
"
"
$(BUILDDIR)
"
$(SPHINXOPTS)
$(O)
html-noexec
:
html-noexec
:
$(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."
...
...
python/dgl/nn/__init__.py
View file @
7e0893e6
"""Package for neural network common components."""
"""Package for neural network common components."""
import
importlib
import
importlib
import
sys
import
sys
import
os
from
..backend
import
backend_name
from
..backend
import
backend_name
def
_load_backend
(
mod_name
):
def
_load_backend
(
mod_name
):
...
@@ -9,4 +10,12 @@ def _load_backend(mod_name):
...
@@ -9,4 +10,12 @@ 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