Standardize "pinned" dtype promotions
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- documentation
Piste de recherche
Commencez par les spécifications liées de setitem, des opérateurs in-place, de clip, de nextafter et la page sur dtype promotion. Comparez leurs règles actuelles avec le comportement de promotion fixé ou borné proposé ; le travail est considéré comme terminé lorsque la règle générale et les références aux fonctions concernées définissent clairement les cas scalaires et les cas de dtypes mixtes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
These functions:
__setitem____iadd__and other in-place operatorsclipnextafter
Have in common that the output dtype must match the dtype of the first parameter. This is unlike most other binary or ternary functions, where all parameters are free to be be promoted against each other.
Q: Are there other such functions?
Beyond this, however, these functions differ substantially in the details:
First parameter is a Python scalar
- in
__setitem__,__iadd__, andclip, the first parameter must be an array. This is an obvious necessity for__setitem__and__iadd__, because it's a method, but not forclip. - in
nextafter, the first parameter can be a Python scalarint | float. The spec is not clear on what must happen in this case; I interpret it as "the output dtype must be the dtype of x if x is an array, otherwise follow the normal dtype promotion rules and return float32 or float64 depending on the dtype of y." It could use an explicit clarification.
Second parameter is an array of different dtype
- In
__setitem__and__iadd__, if the second parameter (value) is an array it can be automatically promoted to the dtype of the first parameter (self). - In
clip, behaviour is undefined. Which to me is weird, because the result would be unambiguous in all cases whereminimumandmaximumare defined and have an output dtype matching the first parameter - for example,clip(int16, min=int8, max=int8). - In
nextafter, behaviour is also undefined, which again to me is weird because it is unambiguous in all cases where__lt__,__gt__, and__eq__are defined; in other wordsnextafter(float64, float32)is unambiguous.
Proposed changes
- Allow
clipto have the first parameter as a Python scalar, like it already happens innextafter - Allow
minandmaxparameters inclipand theyparameter innextafterto be arrays of a dtype promotable tox.dtype, like it already happens in__setitem__ - Add a section to the dtype promotion page for "pinned" or "bound" dtype promotion, defining a general rule
- Have
__setitem__,clip, andnextafterpoint to this general rule
- Langage dominant
- Python
- Étoiles
- 282
- Forks
- 52
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de data-apis/array-api
-
[Bug]: formula for `pinv` is transpose of the pseudoinversePeut-être pris @mdhaber l’a pris il y a 28 jours. Ouvertebug Maintenance Narrative Content
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
-
Maintenance
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
Toutes les issues de data-apis/array-api
Issues similaires
-
[Bug]: LangGraph Store sync put bypasses namespace validationPeut-être pris @ktz03 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
volcengine/OpenViking#6050 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkPeut-être pris @rodricksz4h5 l’a pris aujourd’hui. Ouvertearea/streaming comp/gateway P2 type/security
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
NousResearch/hermes-agent#138245 ·
Les mainteneurs répondent en général sous 1 jour
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepPeut-être pris @github-actions l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour
-
correction metadata
Difficulté 2/5 Moins d'une heure Accessibilité débutants 68/100
acl-org/acl-anthology#10378 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom namePeut-être pris @12YYCCYY16 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
prowler-cloud/prowler#13033 ·
Les mainteneurs répondent en général sous 1 jour