Skip to content

Commit

Permalink
Merge pull request #829 from pfnet/graph-context-interface-update
Browse files Browse the repository at this point in the history
update new GraphContext interface
  • Loading branch information
asi1024 authored Oct 1, 2024
2 parents c493274 + 68f8fba commit 0e842f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pytorch_pfn_extras/onnx/pfto_exporter/export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dataclasses
from functools import partial
import types
import typing
import warnings
Expand Down Expand Up @@ -115,7 +116,11 @@
"special_gammaln": "lgamma",
}

if pytorch_pfn_extras.requires("1.13"):
GraphContext: Any
if pytorch_pfn_extras.requires("2.4"):
from torch.onnx._internal import jit_utils
GraphContext = partial(jit_utils.GraphContext, values_in_env=set())
elif pytorch_pfn_extras.requires("1.13"):
from torch.onnx._internal import jit_utils
GraphContext = jit_utils.GraphContext
else:
Expand Down

0 comments on commit 0e842f7

Please sign in to comment.