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
db57809d
"src/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "55072b4e830704ec56b0725b4ec3a597e07873ae"
Unverified
Commit
db57809d
authored
Jan 31, 2021
by
Zihao Ye
Committed by
GitHub
Jan 31, 2021
Browse files
[hotfix] Add data type check for kernels. (#2598)
* upd * upd
parent
460bb42d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
python/dgl/sparse.py
python/dgl/sparse.py
+9
-0
No files found.
python/dgl/sparse.py
View file @
db57809d
...
@@ -120,6 +120,11 @@ def _gspmm(gidx, op, reduce_op, u, e):
...
@@ -120,6 +120,11 @@ def _gspmm(gidx, op, reduce_op, u, e):
raise
DGLError
(
"We only support gspmm on graph with one edge type"
)
raise
DGLError
(
"We only support gspmm on graph with one edge type"
)
use_u
=
op
!=
'copy_rhs'
use_u
=
op
!=
'copy_rhs'
use_e
=
op
!=
'copy_lhs'
use_e
=
op
!=
'copy_lhs'
if
use_u
and
use_e
:
if
F
.
dtype
(
u
)
!=
F
.
dtype
(
e
):
raise
DGLError
(
"The node features' data type {} doesn't match edge"
" features' data type {}, please convert them to the"
" same type."
.
format
(
F
.
dtype
(
u
),
F
.
dtype
(
e
)))
# deal with scalar features.
# deal with scalar features.
expand_u
,
expand_e
=
False
,
False
expand_u
,
expand_e
=
False
,
False
if
use_u
:
if
use_u
:
...
@@ -219,6 +224,10 @@ def _gsddmm(gidx, op, lhs, rhs, lhs_target='u', rhs_target='v'):
...
@@ -219,6 +224,10 @@ def _gsddmm(gidx, op, lhs, rhs, lhs_target='u', rhs_target='v'):
raise
DGLError
(
"We only support gsddmm on graph with one edge type"
)
raise
DGLError
(
"We only support gsddmm on graph with one edge type"
)
use_lhs
=
op
!=
'copy_rhs'
use_lhs
=
op
!=
'copy_rhs'
use_rhs
=
op
!=
'copy_lhs'
use_rhs
=
op
!=
'copy_lhs'
if
use_lhs
and
use_rhs
:
if
F
.
dtype
(
lhs
)
!=
F
.
dtype
(
rhs
):
raise
DGLError
(
"The operands data type don't match: {} and {}, please convert them"
" to the same type."
.
format
(
F
.
dtype
(
lhs
),
F
.
dtype
(
rhs
)))
# deal with scalar features.
# deal with scalar features.
expand_lhs
,
expand_rhs
=
False
,
False
expand_lhs
,
expand_rhs
=
False
,
False
if
use_lhs
:
if
use_lhs
:
...
...
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