From 7c3129c0de4900141bdfd8a3cbc7673380d17d2e Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 15 Jan 2025 15:39:05 -0500 Subject: [PATCH] black --- src/modeci_mdf/interfaces/pytorch/importer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modeci_mdf/interfaces/pytorch/importer.py b/src/modeci_mdf/interfaces/pytorch/importer.py index 87254a37..37f0650f 100644 --- a/src/modeci_mdf/interfaces/pytorch/importer.py +++ b/src/modeci_mdf/interfaces/pytorch/importer.py @@ -5,6 +5,7 @@ Mike He, "From Models to Computation Graphs (Part I)", https://ad1024.space/articles/22 """ + import inspect import logging @@ -13,6 +14,7 @@ import torch + # We need to monkey patch the torch._C.Node class to add a __getitem__ method # This is for torch 2.0 # From https://github.com/openai/CLIP/issues/79#issuecomment-1624202950 @@ -528,8 +530,10 @@ def pytorch_to_mdf( try: from torch.onnx.symbolic_helper import _set_opset_version except ImportError: + def _set_opset_version(version): from torch.onnx._globals import GLOBALS + GLOBALS.export_onnx_opset_version = version try: