JuliaPy / JuliaPy/PyCall.jl

No-copy version of PyReverseDims for NumPy to Julia arrays

Aperta
#695 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Julia
Stelle
1.5k
Fork
186
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It would be great if there was an equivalent of `PyReverseDims` for the other direction, e.g. a method that takes a `PyArray` and returns a regular Julia Array with the dimensions inverted. For things like images from PIL, the numpy array of size `(nvertical, nhorizontal, ncolor)` mostly comes from NumPy arrays being row-major. In Julia, an array of size `(ncolor, nhorizontal, nvertical)` also feels natural because Julia is column-major. These two arrays would have the same representation in memory, but I cannot figure out how to accomplish this conversion without copying the underlying data, even when using `reinterpret` or `resize`.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reviewing the existing PyReverseDims behavior and the PyArray conversion APIs described in the issue. Determine whether a regular Julia Array can expose the inverted dimensions without copying the underlying data; done means providing the requested no-copy conversion for NumPy arrays, including the image-shaped example.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
julia, numpy
Ambito
data
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.