Skip to content

Commit 1df9228

Browse files
committed
f
1 parent 7bd94a9 commit 1df9228

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

onnx_diagnostic/helpers/helper.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,16 @@ def string_type(
357357
return "SymFloat"
358358

359359
if isinstance(obj, torch.export.dynamic_shapes._DimHint):
360-
if obj in (torch.export.Dim.DYNAMIC, torch.export.dynamic_shapes._DimHintType.DYNAMIC):
360+
cl = (
361+
torch.export.dynamic_shapes._DimHintType
362+
if hasattr(torch.export.dynamic_shapes, "_DimHintType")
363+
else torch.export.Dim
364+
)
365+
if obj in (torch.export.Dim.DYNAMIC, cl.DYNAMIC):
361366
if verbose:
362367
print(f"[string_type] Y8:{type(obj)}")
363368
return "DYNAMIC"
364-
if obj in (torch.export.Dim.AUTO, torch.export.dynamic_shapes._DimHintType.AUTO):
369+
if obj in (torch.export.Dim.AUTO, cl.AUTO):
365370
if verbose:
366371
print(f"[string_type] Y9:{type(obj)}")
367372
return "AUTO"

0 commit comments

Comments
 (0)