Skip to content

Conversation

@titaiwangms
Copy link
Contributor

@titaiwangms titaiwangms commented Oct 23, 2025

@titaiwangms titaiwangms added the module: torchlib Related to the torch/aten function lib in development label Oct 23, 2025
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.45%. Comparing base (8a94ad6) to head (a6712b7).

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/core.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2653      +/-   ##
==========================================
- Coverage   70.46%   70.45%   -0.01%     
==========================================
  Files         224      224              
  Lines       26572    26576       +4     
  Branches     2637     2637              
==========================================
+ Hits        18723    18725       +2     
- Misses       6928     6930       +2     
  Partials      921      921              

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

return op.Floor(op.Abs(self)) * op.Sign(self)


@torch_op("math::trunc", trace_only=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possible to use a single cast to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I don't understand.

Copy link
Collaborator

Choose a reason for hiding this comment

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

A single cast to INT64 should do the truncation

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.

ConversionError: Error when translating node %trunc_12 : [num_users=4] = call_function[target=math.trunc](args = (%mul_104,), kwargs = {})

2 participants