Skip to content

Commit

Permalink
Raise error if key cannot be found in graph runtime inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tkonolige committed Jul 27, 2020
1 parent 5828501 commit 321cae2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/tvm/contrib/graph_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ def set_input(self, key=None, value=None, **params):
Additional arguments
"""
if key is not None:
self._get_input(key).copyfrom(value)
v = self._get_input(key)
if v is None:
raise RuntimeError("Could not find '%s' in graph's inputs" % key)
v.copyfrom(value)

if params:
# upload big arrays first to avoid memory issue in rpc mode
Expand Down

0 comments on commit 321cae2

Please sign in to comment.