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
36ea5392
Commit
36ea5392
authored
Mar 27, 2018
by
nhynes
Committed by
Tianqi Chen
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only warn when unable to find a graph input (#1052)
parent
cc7a8fcf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/runtime/graph/graph_runtime.cc
+8
-4
No files found.
src/runtime/graph/graph_runtime.cc
View file @
36ea5392
...
@@ -88,7 +88,7 @@ class GraphRuntime : public ModuleNode {
...
@@ -88,7 +88,7 @@ class GraphRuntime : public ModuleNode {
return
static_cast
<
int
>
(
i
);
return
static_cast
<
int
>
(
i
);
}
}
}
}
LOG
(
FATAL
)
<<
"cannot find "
<<
name
<<
" among input"
;
LOG
(
WARNING
)
<<
"Warning: cannot find
\"
"
<<
name
<<
"
\
"
among input"
;
return
-
1
;
return
-
1
;
}
}
/*!
/*!
...
@@ -459,7 +459,8 @@ void GraphRuntime::LoadParams(dmlc::Stream* strm) {
...
@@ -459,7 +459,8 @@ void GraphRuntime::LoadParams(dmlc::Stream* strm) {
CHECK
(
size
==
names
.
size
())
CHECK
(
size
==
names
.
size
())
<<
"Invalid parameters file format"
;
<<
"Invalid parameters file format"
;
for
(
size_t
i
=
0
;
i
<
size
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
size
;
++
i
)
{
uint32_t
in_idx
=
GetInputIndex
(
names
[
i
]);
int
in_idx
=
GetInputIndex
(
names
[
i
]);
CHECK_GE
(
in_idx
,
0
)
<<
"Found param for non-existent input: "
<<
names
[
i
];
uint32_t
eid
=
this
->
entry_id
(
input_nodes_
[
in_idx
],
0
);
uint32_t
eid
=
this
->
entry_id
(
input_nodes_
[
in_idx
],
0
);
CHECK_LT
(
eid
,
data_entry_
.
size
());
CHECK_LT
(
eid
,
data_entry_
.
size
());
LoadDLTensor
(
strm
,
&
data_entry_
[
eid
]);
LoadDLTensor
(
strm
,
&
data_entry_
[
eid
]);
...
@@ -585,7 +586,8 @@ PackedFunc GraphRuntime::GetFunction(
...
@@ -585,7 +586,8 @@ PackedFunc GraphRuntime::GetFunction(
if
(
name
==
"set_input"
)
{
if
(
name
==
"set_input"
)
{
return
PackedFunc
([
sptr_to_self
,
this
](
TVMArgs
args
,
TVMRetValue
*
rv
)
{
return
PackedFunc
([
sptr_to_self
,
this
](
TVMArgs
args
,
TVMRetValue
*
rv
)
{
if
(
args
[
0
].
type_code
()
==
kStr
)
{
if
(
args
[
0
].
type_code
()
==
kStr
)
{
this
->
SetInput
(
this
->
GetInputIndex
(
args
[
0
]),
args
[
1
]);
int
in_idx
=
this
->
GetInputIndex
(
args
[
0
]);
if
(
in_idx
>=
0
)
this
->
SetInput
(
in_idx
,
args
[
1
]);
}
else
{
}
else
{
this
->
SetInput
(
args
[
0
],
args
[
1
]);
this
->
SetInput
(
args
[
0
],
args
[
1
]);
}
}
...
@@ -597,7 +599,9 @@ PackedFunc GraphRuntime::GetFunction(
...
@@ -597,7 +599,9 @@ PackedFunc GraphRuntime::GetFunction(
}
else
if
(
name
==
"get_input"
)
{
}
else
if
(
name
==
"get_input"
)
{
return
PackedFunc
([
sptr_to_self
,
this
](
TVMArgs
args
,
TVMRetValue
*
rv
)
{
return
PackedFunc
([
sptr_to_self
,
this
](
TVMArgs
args
,
TVMRetValue
*
rv
)
{
if
(
args
[
0
].
type_code
()
==
kStr
)
{
if
(
args
[
0
].
type_code
()
==
kStr
)
{
this
->
GetInput
(
this
->
GetInputIndex
(
args
[
0
]),
args
[
1
]);
int
in_idx
=
this
->
GetInputIndex
(
args
[
0
]);
CHECK_GE
(
in_idx
,
0
);
this
->
GetInput
(
in_idx
,
args
[
1
]);
}
else
{
}
else
{
this
->
GetInput
(
args
[
0
],
args
[
1
]);
this
->
GetInput
(
args
[
0
],
args
[
1
]);
}
}
...
...
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