Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
37bd8125
Unverified
Commit
37bd8125
authored
Apr 17, 2020
by
windclarion
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RUNTIME][CRT] support DLTensor whose ndim == 0 (#5344)
Signed-off-by: windclarion <windclarion@gmail.com>
parent
84d1eec3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/runtime/crt/ndarray.c
+3
-3
No files found.
src/runtime/crt/ndarray.c
View file @
37bd8125
...
...
@@ -68,15 +68,15 @@ int TVMNDArray_Load(TVMNDArray * ret, const char ** strm) {
ctx
=
((
DLContext
*
)
*
strm
)[
0
];
*
strm
+=
sizeof
(
ctx
);
// NOLINT(*)
ndim
=
((
uint32_t
*
)
*
strm
)[
0
];
*
strm
+=
sizeof
(
ndim
);
// NOLINT(*)
dtype
=
((
DLDataType
*
)
*
strm
)[
0
];
*
strm
+=
sizeof
(
dtype
);
// NOLINT(*)
if
((
ndim
<
=
0
)
||
(
ndim
>
TVM_CRT_MAX_NDIM
))
{
fprintf
(
stderr
,
"Invalid ndim=%d: expected to be
1
~ %d.
\n
"
,
ndim
,
TVM_CRT_MAX_NDIM
);
if
((
ndim
<
0
)
||
(
ndim
>
TVM_CRT_MAX_NDIM
))
{
fprintf
(
stderr
,
"Invalid ndim=%d: expected to be
0
~ %d.
\n
"
,
ndim
,
TVM_CRT_MAX_NDIM
);
status
=
-
1
;
}
if
(
ctx
.
device_type
!=
kDLCPU
)
{
fprintf
(
stderr
,
"Invalid DLTensor context: can only save as CPU tensor
\n
"
);
status
=
-
1
;
}
int64_t
shape
[
TVM_CRT_MAX_NDIM
];
int64_t
shape
[
TVM_CRT_MAX_NDIM
]
=
{
0
}
;
uint32_t
idx
;
if
(
ndim
!=
0
)
{
for
(
idx
=
0
;
idx
<
ndim
;
idx
++
)
{
...
...
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