Skip to content

Add Tests for PR#45 #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 16, 2025

Conversation

codecov-ai[bot]
Copy link
Contributor

@codecov-ai codecov-ai bot commented Jun 2, 2025

This PR adds tests for #45

Commits:

  • Add unit tests for get_constant_tensor function

This commit adds a new test file to validate the newly added get_constant_tensor function.
The tests cover various scenarios including direct constant values, values without producer nodes,
values with non-Constant producer nodes, and values produced by Constant nodes with different
attribute types (float, int, tensor).

justinchuby and others added 4 commits June 1, 2025 09:47
Copy link

codecov bot commented Jun 2, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
580 6 574 0
View the top 3 failed test(s) by shortest run time
src.onnx_ir._convenience.get_constant_tensor_test.GetConstantTensorTest::test_constant_float_value
Stack Traces | 0.002s run time
src\onnx_ir\_convenience\get_constant_tensor_test.py:54: in test_constant_float_value
    graph = _core.Graph(name="test_graph")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: Graph.__init__() missing 2 required positional arguments: 'inputs' and 'outputs'
src.onnx_ir._convenience.get_constant_tensor_test.GetConstantTensorTest::test_constant_tensor_value
Stack Traces | 0.002s run time
src\onnx_ir\_convenience\get_constant_tensor_test.py:98: in test_constant_tensor_value
    graph = _core.Graph(name="test_graph")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: Graph.__init__() missing 2 required positional arguments: 'inputs' and 'outputs'
src.onnx_ir._convenience.get_constant_tensor_test.GetConstantTensorTest::test_no_producer_node
Stack Traces | 0.002s run time
src\onnx_ir\_convenience\get_constant_tensor_test.py:28: in test_no_producer_node
    value = _core.Value(name="test_value", type=_core.TensorType(elem_type=_enums.DataType.FLOAT))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: _TensorTypeBase.__init__() got an unexpected keyword argument 'elem_type'

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

Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@justinchuby justinchuby force-pushed the justinchu/constant-tensor branch from 898a6c6 to 4fec7af Compare June 3, 2025 15:58
@justinchuby justinchuby marked this pull request as ready for review June 16, 2025 18:32
@justinchuby justinchuby requested review from titaiwangms and a team as code owners June 16, 2025 18:32
@justinchuby justinchuby merged commit 8cbf038 into justinchu/constant-tensor Jun 16, 2025
6 of 16 checks passed
@justinchuby justinchuby deleted the ai-tests-for-pr45-1748903525 branch June 16, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant