Skip to content

Commit

Permalink
remove unreachable assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetcocoa committed Apr 4, 2023
1 parent eb75592 commit 67cde54
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5016,14 +5016,10 @@ def from_pytorch(
func_args.append(arg)

# Ensures the order of data_input is the same as the order of inputs specified in input_info.
_data_inputs = []
for input_info in input_infos:
_data_input = [di for di in data_inputs if di.name_hint == input_info[0]]
if len(_data_input) != 1:
msg = "Unexpected input name ({}) which is unreachable.".format(input_info[0])
raise RuntimeError(msg)
_data_inputs.append(_data_input[0])
data_inputs = _data_inputs
order_input_infos = {input_info[0]: idx for idx, input_info in enumerate(input_infos)}
data_inputs = sorted(
data_inputs, key=lambda data_input: order_input_infos[data_input.name_hint]
)

func_args = data_inputs + func_args

Expand Down

0 comments on commit 67cde54

Please sign in to comment.