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
949f87cc
Unverified
Commit
949f87cc
authored
Nov 16, 2022
by
czkkkkkk
Committed by
GitHub
Nov 16, 2022
Browse files
[FFI] Change enumeration name in DGLObjectTypeCode to avoid conflict with Pytorch (#4905)
parent
c235d17d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
include/dgl/runtime/c_runtime_api.h
include/dgl/runtime/c_runtime_api.h
+3
-3
python/dgl/_ffi/_cython/base.pxi
python/dgl/_ffi/_cython/base.pxi
+3
-3
python/dgl/_ffi/_cython/function.pxi
python/dgl/_ffi/_cython/function.pxi
+5
-5
No files found.
include/dgl/runtime/c_runtime_api.h
View file @
949f87cc
...
...
@@ -64,9 +64,9 @@ typedef enum {
* objects passed between C and Python.
*/
typedef
enum
{
kInt
=
0U
,
kUInt
=
1U
,
kFloat
=
2U
,
k
Object
Int
=
0U
,
k
Object
UInt
=
1U
,
k
Object
Float
=
2U
,
kHandle
=
3U
,
kNull
=
4U
,
kDGLDataType
=
5U
,
...
...
python/dgl/_ffi/_cython/base.pxi
View file @
949f87cc
...
...
@@ -7,9 +7,9 @@ from libc.stdint cimport int32_t, int64_t, uint64_t, uint8_t, uint16_t
import
ctypes
cdef
enum
DGLObjectTypeCode
:
kInt
=
0
kUInt
=
1
kFloat
=
2
k
Object
Int
=
0
k
Object
UInt
=
1
k
Object
Float
=
2
kHandle
=
3
kNull
=
4
kDGLDataType
=
5
...
...
python/dgl/_ffi/_cython/function.pxi
View file @
949f87cc
...
...
@@ -94,10 +94,10 @@ cdef inline int make_arg(object arg,
tcode
[
0
]
=
arg
.
__class__
.
_dgl_tcode
elif
isinstance
(
arg
,
(
int
,
long
)):
value
[
0
].
v_int64
=
arg
tcode
[
0
]
=
kInt
tcode
[
0
]
=
k
Object
Int
elif
isinstance
(
arg
,
float
):
value
[
0
].
v_float64
=
arg
tcode
[
0
]
=
kFloat
tcode
[
0
]
=
k
Object
Float
elif
isinstance
(
arg
,
str
):
tstr
=
c_str
(
arg
)
value
[
0
].
v_str
=
tstr
...
...
@@ -108,7 +108,7 @@ cdef inline int make_arg(object arg,
tcode
[
0
]
=
kNull
elif
isinstance
(
arg
,
Number
):
value
[
0
].
v_float64
=
arg
tcode
[
0
]
=
kFloat
tcode
[
0
]
=
k
Object
Float
elif
isinstance
(
arg
,
CTypesDGLDataType
):
tstr
=
c_str
(
str
(
arg
))
value
[
0
].
v_str
=
tstr
...
...
@@ -172,9 +172,9 @@ cdef inline object make_ret(DGLValue value, int tcode):
return
make_ret_object
(
value
.
v_handle
)
elif
tcode
==
kNull
:
return
None
elif
tcode
==
kInt
:
elif
tcode
==
k
Object
Int
:
return
value
.
v_int64
elif
tcode
==
kFloat
:
elif
tcode
==
k
Object
Float
:
return
value
.
v_float64
elif
tcode
==
kNDArrayContainer
:
return
c_make_array
(
value
.
v_handle
,
False
)
...
...
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