Skip to content

Commit 61cb2d1

Browse files
committed
fix
1 parent b3e9c11 commit 61cb2d1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

onnx_diagnostic/torch_models/test_helper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,9 @@ def validate_model(
378378
summary["model_inputs"] = string_type(data["inputs"], with_shape=True)
379379
summary["model_shapes"] = string_type(data["dynamic_shapes"])
380380
summary["model_class"] = data["model"].__class__.__name__
381-
summary["model_module"] = data["model"].__class__.__module__
382-
if summary["model_module"] in sys.modules and isinstance(
383-
sys.modules[summary["model_module"]].__file__, str
384-
):
385-
summary["model_file"] = sys.modules[summary["model_module"]].__file__
381+
summary["model_module"] = str(data["model"].__class__.__module__)
382+
if summary["model_module"] in sys.modules:
383+
summary["model_file"] = str(sys.modules[summary["model_module"]].__file__)
386384
summary["model_config_class"] = data["configuration"].__class__.__name__
387385
summary["model_config"] = str(data["configuration"].to_dict()).replace(" ", "")
388386
summary["model_id"] = model_id

0 commit comments

Comments
 (0)