Skip to content

Commit c60c090

Browse files
authored
[IR] Use shape.freeze() (#2247)
Use the shape.freeze() method in the codebase
1 parent fa888ee commit c60c090

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

onnxscript/ir/_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def __init__(
361361
self._shape = Shape(getattr(value, "shape"), frozen=True) # noqa: B009
362362
else:
363363
self._shape = shape
364-
self._shape._frozen = True
364+
self._shape.freeze()
365365
if dtype is None:
366366
if isinstance(value, np.ndarray):
367367
self._dtype = _enums.DataType.from_numpy(value.dtype)
@@ -564,7 +564,7 @@ def __init__(
564564
self._dtype: _enums.DataType = dtype
565565
self.name: str = name # mutable
566566
self._shape: Shape = shape
567-
self._shape._frozen = True
567+
self._shape.freeze()
568568
self.doc_string: str | None = doc_string # mutable
569569
self._array: np.ndarray | None = None
570570
self.raw: mmap.mmap | None = None
@@ -783,7 +783,7 @@ def __init__(
783783
self._shape = Shape(getattr(value, "shape"), frozen=True) # noqa: B009
784784
else:
785785
self._shape = shape
786-
self._shape._frozen = True
786+
self._shape.freeze()
787787
self._raw = value
788788
self.name = name
789789
self.doc_string = doc_string

0 commit comments

Comments
 (0)