Unverified Commit b2720c9e authored by Ningxin Zheng's avatar Ningxin Zheng Committed by GitHub
Browse files

Fix a bug raised by issue 3372. (#3399)

* Fix a bug raised by issue 3372.

corner case: the input tensor may also be the input tensor of the whole
model.
parent 972de844
...@@ -441,7 +441,11 @@ class TorchModuleGraph(TorchGraph): ...@@ -441,7 +441,11 @@ class TorchModuleGraph(TorchGraph):
input_tensors = list(list_construct_cpp.inputs()) input_tensors = list(list_construct_cpp.inputs())
for _tensor in input_tensors: for _tensor in input_tensors:
debug_name = _tensor.debugName() debug_name = _tensor.debugName()
input_order.append(self.output_to_node[debug_name].unique_name) if debug_name in self.output_to_node:
input_order.append(self.output_to_node[debug_name].unique_name)
else:
# the input tensor may be the input tensor of the whole model
input_order.append(None)
cat_info['in_order'] = input_order cat_info['in_order'] = input_order
input_shapes = [t.type().sizes() for t in input_tensors] input_shapes = [t.type().sizes() for t in input_tensors]
cat_info['in_shape'] = input_shapes cat_info['in_shape'] = input_shapes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment