Skip to content
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

feat: apply type promotion rules according to the device context #889

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Jan 23, 2025

This PR:

  • closes Device-specific type promotion rules #672 by clarifying that device info must be taken into account when applying type promotion rules in result_type and can_cast. As not all devices can support all data types, both functions need to explicitly account for whether an array or dtype can be cast and/or promoted to a desired dtype on a given device.
  • when provided only dtypes, both functions are required to only consider the full type promotion graph.
  • when at least one argument is an array, both functions must account for device capabilities.
  • for result_type, if two or more array arguments belong to separate devices, behavior is left unspecified and thus implementation-dependent.

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Type Promotion Type promotion. labels Jan 23, 2025
@kgryte kgryte added this to the v2024 milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Type Promotion Type promotion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Device-specific type promotion rules
1 participant