Skip to content

Commit 18862b9

Browse files
committed
Lint fixes
1 parent f816280 commit 18862b9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

onnxscript/optimizer/_constant_folding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def is_constant_op(node: ir.Node) -> bool:
5353
# use ORT's implementation if we want to.
5454

5555

56-
def _process_constant_node(node: ir.node) -> None:
56+
def _process_constant_node(node: ir.Node) -> None:
5757
"""Sets const_value of output value of a Constant op node."""
5858
if node.op_type != "Constant" or node.domain not in {"", "ai.onnx"}:
5959
return
@@ -660,7 +660,7 @@ def process_node(self, node: ir.Node):
660660
logger.debug(
661661
"Node [%s]: Replacing input %s with %s",
662662
node.name,
663-
value.name,
663+
value.name, # type: ignore[union-attr]
664664
sym_value.name,
665665
)
666666
node.replace_input_with(i, sym_value)

onnxscript/rewriter/_ir_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import onnxscript.ir as ir
66
from onnxscript.optimizer import basic_constant_propagation
77

8+
89
def get_const_value(value: ir.Value) -> ir.TensorProtocol | None:
910
node = value.producer()
1011
if node is not None:
1112
basic_constant_propagation([node])
12-
return value.const_value
13+
return value.const_value

0 commit comments

Comments
 (0)