Skip to content

Trivial cleanup of onnxscript converter#2839

Open
gramalingam wants to merge 3 commits intomainfrom
rama/cleanup
Open

Trivial cleanup of onnxscript converter#2839
gramalingam wants to merge 3 commits intomainfrom
rama/cleanup

Conversation

@gramalingam
Copy link
Collaborator

  • Change names to match suggested style (snake_case etc.)
  • Add _ to internal methods where missing
  • Remove a couple of lines of useless code

gramalingam and others added 3 commits March 3, 2026 16:52
…int suppression

Rename camelCase local variables to snake_case in converter.py:
  thenGraph -> then_graph, elseGraph -> else_graph,
  thenAttr -> then_attr, elseAttr -> else_attr

Rename camelCase nested function visitBlock -> visit_block in
analysis.py (do_liveness_analysis and exposed_uses).

Remove pylint disable=inconsistent-return-statements on
_translate_opset_expr since all code paths already call self.fail()
(which is NoReturn).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prefix internal implementation methods with _ to clarify the
public API boundary of the Converter class:
  emit -> _emit, emit1 -> _emit1,
  is_castable -> _is_castable,
  generate_unique_name -> _generate_unique_name,
  warn -> _warn, fail -> _fail

Update autocast.py call sites accordingly with pylint
protected-access suppressions (tightly coupled sibling module).

The true public API remains: translate_function_def and
translate_function_signature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
@codecov
Copy link

codecov bot commented Mar 4, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
12174 1 12173 944
View the full list of 1 ❄️ flaky test(s)
tests.function_libs.torch_lib.ops_test.TestOutputConsistencyFullGraphCPU::test_output_match_opinfo__logsumexp_cpu_float16

Flake rate in main: 14.58% (Passed 252 times, Failed 43 times)

Stack Traces | 0.33s run time
.../function_libs/torch_lib/ops_test.py:243: in run_test_output_match
    torch.testing.assert_close(
E   AssertionError: Tensor-likes are not close!
E   
E   Mismatched elements: 1 / 5 (20.0%)
E   Greatest absolute difference: 2.288818359375e-05 at index (1,) (up to 1e-05 allowed)
E   Greatest relative difference: 0.0022869110107421875 at index (1,) (up to 0.001 allowed)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant