Skip to content

Commit f5db9d8

Browse files
committed
Type annotation type
Signed-off-by: Ganesan Ramalingam <[email protected]>
1 parent 1df3ac6 commit f5db9d8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

onnxscript/_internal/values.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import typing
1414
from enum import IntFlag
1515
from typing import ( # type: ignore[attr-defined]
16+
TYPE_CHECKING,
1617
Any,
1718
Callable,
1819
ClassVar,
@@ -35,6 +36,9 @@
3536
from onnxscript.ir import _schemas
3637
from onnxscript.onnx_types import ONNXType
3738

39+
if TYPE_CHECKING:
40+
from onnxscript._internal.type_annotation import TypeAnnotationValue
41+
3842
_R = TypeVar("_R")
3943
_P = ParamSpec("_P")
4044

@@ -886,9 +890,13 @@ class DynamicKind(IntFlag):
886890

887891
class Dynamic(SymbolValue):
888892
def __init__(
889-
self, onnx_var: ir.Value, kind: DynamicKind, info: sourceinfo.SourceInfo, typeinfo=None
893+
self,
894+
onnx_var: ir.Value,
895+
kind: DynamicKind,
896+
info: sourceinfo.SourceInfo,
897+
typeinfo: TypeAnnotationValue | None = None,
890898
) -> None:
891-
"""Initializes Dynamic.
899+
"""Represents an ir.Value with some extra information.
892900
893901
Arguments:
894902
onnx_var: the name of the ONNX variable used to represent this value

0 commit comments

Comments
 (0)