Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed Jan 7, 2025
1 parent 795906a commit c6ecd5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions onnxscript/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ def translate_slice(slice_expr: ast.Slice) -> tuple[str, str, str]:
non_scalar_indices.extend(scalar_indices)
if non_scalar_indices:
last_axis, _ = non_scalar_indices[-1]
else:
# TODO(justinchuby): Clarify what last_axis should be when non_scalar_indices is False
last_axis = None
for axis, index_expr in non_scalar_indices:
index_value = self._translate_expr(index_expr)
axis_attr = self._make_onnx_attr("axis", axis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def _override_with_symbolic_value_info_proto(self, onnx_model: onnx.ModelProto):
existing_value_info = {info.name: info for info in onnx_model.graph.value_info}

# Override value_info for top level graph inputs.
for input in self.torch_graph.inputs():
for input in self.torch_graph.inputs(): # pylint: disable=not-an-iterable
if input not in self._value_to_tensor:
raise RuntimeError(f"Input '{input.debugName()}' has no type.")
tensor = self._value_to_tensor[input]
Expand All @@ -847,7 +847,7 @@ def _override_with_symbolic_value_info_proto(self, onnx_model: onnx.ModelProto):
break

# Override value_info for top level graph outputs.
for output in self.torch_graph.outputs():
for output in self.torch_graph.outputs(): # pylint: disable=not-an-iterable
if output not in self._value_to_tensor:
raise RuntimeError(f"Output '{output.debugName()}' has no type.")
tensor = self._value_to_tensor[output]
Expand Down

0 comments on commit c6ecd5d

Please sign in to comment.