Skip to content

Conversation

ppapierk
Copy link

Downcasting float32 values beyond target type value range is an undefined behaviour according to torch documentation.

Downcasting float32 values beyond target type value range is
an undefined behaviour according to torch documentation.
@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 15:33
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

Adds an exception to handle undefined behavior in float-to-integer conversion test cases for XPU devices. The PR addresses cases where downcasting float32 values beyond the target integer type's value range leads to undefined behavior.

  • Extended the conditional check to include XPU alongside HIP for handling divergent float-to-int conversion
  • Added explanatory comments for XPU's divergent behavior with int8 and int16 conversions
  • Applied minor code formatting improvements to the dtypesIfCUDA decorator

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tadkrawiec tadkrawiec requested a review from daisyden September 25, 2025 09:14
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.

[Evaluated] Issues in test_tensor_creation_ops.py
2 participants