Skip to content

Commit

Permalink
Handle case where ListConstruct makes a python list which is output o…
Browse files Browse the repository at this point in the history
…f whole model (#7088)
  • Loading branch information
Trevor Morris authored Dec 11, 2020
1 parent 1e6e202 commit df5ba51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3038,7 +3038,10 @@ def from_pytorch(script_module, input_infos, custom_convert_map=None, default_dt
qnn_torch.add_quant_params(tvm_params, weight_quant_params)
converter.update_convert_map(qnn_torch.convert_map)

ret = converter.convert_operators(_get_operator_nodes(graph.nodes()), outputs, ret_name)
ret = converter.convert_operators(_get_operator_nodes(graph.nodes()), outputs, ret_name)[0]
if isinstance(ret, list):
# ListConstruct kept original python list. Convert to tuple.
ret = _expr.Tuple(ret)

mod["main"] = tvm.relay.Function(_analysis.free_vars(ret[0]), ret[0])
mod["main"] = tvm.relay.Function(_analysis.free_vars(ret), ret)
return transform.RemoveUnusedFunctions()(mod), tvm_params

0 comments on commit df5ba51

Please sign in to comment.