diff --git a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py index 1cc4f39d35b49..76f92bea4ce9c 100644 --- a/python/tvm/autotvm/graph_tuner/base_graph_tuner.py +++ b/python/tvm/autotvm/graph_tuner/base_graph_tuner.py @@ -152,6 +152,9 @@ def __init__(self, graph, input_shapes, records, target_ops, self._graph = graph self._in_nodes_dict = get_in_nodes(self._node_list, self._target_ops, input_shapes.keys()) + if len(self._in_nodes_dict) == 0: + raise RuntimeError("Could not find any input nodes with whose " + "operator is one of %s" % self._target_ops) self._out_nodes_dict = get_out_nodes(self._in_nodes_dict) self._fetch_cfg() self._opt_out_op = OPT_OUT_OP