Skip to content

Conversation

justinchuby
Copy link
Member

@justinchuby justinchuby commented Sep 6, 2025

A convenience constructor for Value that supports an easier way of supplying arguments.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a convenience constructor function for creating Value objects with a more user-friendly interface. The constructor allows users to specify values through multiple parameter combinations and includes validation logic.

Key changes:

  • New value() convenience constructor function with flexible parameter handling
  • Updated import to include the new value function in the public API
  • Type annotation improvement for the existing tensor() function

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/onnx_ir/_convenience/_constructors.py Adds new value() function and fixes type annotation for tensor()
src/onnx_ir/init.py Exports the new value function in the public API

Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.62%. Comparing base (b9ecb98) to head (6f6e705).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
+ Coverage   76.51%   76.62%   +0.11%     
==========================================
  Files          40       40              
  Lines        4879     4894      +15     
  Branches      971      977       +6     
==========================================
+ Hits         3733     3750      +17     
+ Misses        857      854       -3     
- Partials      289      290       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby added this to the 0.1.9 milestone Sep 6, 2025
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Copy link
Collaborator

@titaiwangms titaiwangms left a comment

Choose a reason for hiding this comment

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

I thought ir.Value was easy enough? OR it's for consistency?

@justinchuby
Copy link
Member Author

justinchuby commented Sep 8, 2025 via email

@justinchuby
Copy link
Member Author

  1. Call it ir.val to disambiguate from Value?
  2. Deprecated Input

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby justinchuby merged commit 8ba415c into main Sep 9, 2025
23 checks passed
@justinchuby justinchuby deleted the justinchu/value-constructor branch September 9, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants