From 068ba95b58425955450ea28c30a04246bfae8444 Mon Sep 17 00:00:00 2001 From: liwangshengya Date: Wed, 29 Mar 2023 12:31:13 +0800 Subject: [PATCH 1/2] Fix a bug in the _get_pytorch_value_type function --- python/tvm/relay/frontend/pytorch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/pytorch.py b/python/tvm/relay/frontend/pytorch.py index 89464face725..505e9c1e990d 100644 --- a/python/tvm/relay/frontend/pytorch.py +++ b/python/tvm/relay/frontend/pytorch.py @@ -4493,7 +4493,7 @@ def _get_pytorch_value_type(typ, default_dtype="float32"): return "ListType" elif kind in ["IntType", "FloatType", "BoolType", "StringType", "OptionalType"]: pt_dtype = str(typ).lower() - dtype = pt_dtype if pt_dtype == "OptionalType" else _convert_data_type(pt_dtype) + dtype=pt_dtype if kind == "OptionalType" else _convert_data_type(pt_dtype) return dtype else: return "UnsupportedType" From 4c13cf923cec3b30c7a5e64cd6b6eaaa846568ef Mon Sep 17 00:00:00 2001 From: liwangshengya Date: Wed, 29 Mar 2023 15:32:45 +0800 Subject: [PATCH 2/2] Fix lint --- python/tvm/relay/frontend/pytorch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/pytorch.py b/python/tvm/relay/frontend/pytorch.py index 505e9c1e990d..6906daccad00 100644 --- a/python/tvm/relay/frontend/pytorch.py +++ b/python/tvm/relay/frontend/pytorch.py @@ -4493,7 +4493,7 @@ def _get_pytorch_value_type(typ, default_dtype="float32"): return "ListType" elif kind in ["IntType", "FloatType", "BoolType", "StringType", "OptionalType"]: pt_dtype = str(typ).lower() - dtype=pt_dtype if kind == "OptionalType" else _convert_data_type(pt_dtype) + dtype = pt_dtype if kind == "OptionalType" else _convert_data_type(pt_dtype) return dtype else: return "UnsupportedType"