diff --git a/python/tvm/relax/frontend/torch/exported_program_translator.py b/python/tvm/relax/frontend/torch/exported_program_translator.py index bc7a4c4cb046..3d0820af24fd 100644 --- a/python/tvm/relax/frontend/torch/exported_program_translator.py +++ b/python/tvm/relax/frontend/torch/exported_program_translator.py @@ -369,7 +369,7 @@ def create_input_vars( torch_dtype = exported_program.tensor_constants[spec.target].dtype elif spec.kind is torch.export.graph_signature.InputKind.USER_INPUT: for node in exported_program.graph.find_nodes(op="placeholder", target=spec.target): - if node.name == name_hint: + if node.name == name_hint and "tensor_meta" in node.meta: shape = node.meta["tensor_meta"].shape torch_dtype = node.meta["tensor_meta"].dtype break