Skip to content

Conversation

@justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Dec 12, 2025

Previously the Scalar_Tensor overload will fail because the first arg will be a scalar which does not have dtype.

@justinchuby justinchuby added the module: torchlib Related to the torch/aten function lib in development label Dec 12, 2025
@justinchuby justinchuby enabled auto-merge (squash) December 12, 2025 21:41
@justinchuby justinchuby requested a review from Copilot December 12, 2025 21:42
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.07%. Comparing base (a3883a6) to head (4ce07c9).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2727      +/-   ##
==========================================
- Coverage   70.07%   70.07%   -0.01%     
==========================================
  Files         226      226              
  Lines       27266    27276      +10     
  Branches     2754     2754              
==========================================
+ Hits        19107    19113       +6     
- Misses       7209     7213       +4     
  Partials      950      950              

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

Copy link
Contributor

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 fixes the aten::remainder.Scalar_Tensor overload which previously failed because it attempted to access the dtype attribute on a scalar value. The fix separates the three overload variants into distinct functions, ensuring that dtype is always obtained from a tensor operand.

  • Split the combined decorator for .Tensor and .Scalar overloads into separate implementations
  • Added dedicated implementation for .Scalar overload (Tensor, float)
  • Added dedicated implementation for .Scalar_Tensor overload (float, Tensor)

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Copy link
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@justinchuby justinchuby added this to the 0.5.7 milestone Dec 12, 2025
@justinchuby justinchuby merged commit da967e3 into main Dec 12, 2025
39 checks passed
@justinchuby justinchuby deleted the justinchu/remainder-fix branch December 12, 2025 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: torchlib Related to the torch/aten function lib in development

Projects

Development

Successfully merging this pull request may close these issues.

4 participants