Skip to content

Commit ffcd801

Browse files
committed
fix
1 parent 1915ed3 commit ffcd801

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

onnx_diagnostic/export/control_flow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .api import to_onnx
1111

1212
_TEST_EXPORT = False
13-
_REGISTERED_SCHEMA = {}
13+
_REGISTERED_SCHEMA = {} # type: ignore[var-annotated]
1414
_DISPATCHER = None
1515

1616

@@ -141,14 +141,14 @@ def make_custom_loop_for(
141141

142142

143143
def convert_custom_loop_into_onnx(
144-
g: "GraphBuilder", # noqa: F821
144+
g: Any, # "GreaphBuilder"
145145
sts: Dict[str, Any],
146146
outputs: List[str],
147147
*args: str,
148148
body: onnx.GraphProto,
149149
reduction_dim: Optional[Tuple[int, ...]] = None,
150150
name: str = "loop_for",
151-
) -> Tuple[str, ...]:
151+
) -> Union[str, Tuple[str, ...]]:
152152
graph = body.graph if isinstance(body, onnx.ModelProto) else body
153153
assert isinstance(
154154
graph, onnx.GraphProto

onnx_diagnostic/export/control_flow_research.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def gen_schema(self, n_iter, body_fn, operands):
2929
from torch._higher_order_ops.schema import HopSchemaGenerator
3030
from torch._higher_order_ops.utils import materialize_as_graph
3131

32-
body_gm: torch.fx.GraphModule = materialize_as_graph(
32+
body_gm: torch.fx.GraphModule = materialize_as_graph( # type: ignore[annotation-unchecked]
3333
body_fn, (torch.tensor(0, dtype=torch.int64), *operands)
3434
)
3535
(

0 commit comments

Comments
 (0)