Is indexing with a variable number of indices supported?
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
Piste de recherche
Start by reading ArrayBase::slice() and the s! macro, then compare the requested variable-index behavior with the linked NumPy example. A completed investigation should establish whether ndarray supports the operation, identify a documented workaround or define what support would need to add, and update the linked Stack Overflow answer.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I'd like to index a tensor along all but the last axis, getting as a result a 1d view of the innermost axis. I thought I'd be able to use ArrayBase::slice() for this, but I need create the index with the s! macro and I can't figure out how to do that with a variable number of indices (such as if the user provides the coordinates of the spatial dimensions in a tensor, and I want to slice on that leaving a 1d view of the feature dimension where the feature dimension is the innermost dimension).
I asked a stack overflow question for this here, if it is indeed supported then perhaps we could add a stack overflow answer there? If not, when would support be added and is there a workaround in the meantime?
The equivalent numpy feature, which is actually slightly more general than my specific use case since I only need a view on the innermost axis, is here
- Langage dominant
- Rust
- Étoiles
- 4.3k
- Forks
- 391
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
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 rust-ndarray/ndarray
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
rust-ndarray/ndarray#1612 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
rust-ndarray/ndarray#1617 · 1 commentaire ·
-
Stack overflow in `triu` Ouvertebug good first issue
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
rust-ndarray/ndarray#1615 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
rust-ndarray/ndarray#1610 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
rust-ndarray/ndarray#1609 ·
Toutes les issues de rust-ndarray/ndarray
Issues similaires
-
risk:low runtime status:in-progress type:test
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
EricSpencer00/Resilient#4835 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
cesarferreira/stax#890 ·