File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments