Construction from negative strides?

Abierto
#842 3 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
rust
Área
data

Línea de trabajo

Start with the linked PyO3/rust-numpy issue for the full context, then inspect the referenced ndarray src/impl_raw_views.rs debug assertion. Determine whether negative-stride construction should have a public unsafe API and why strides are represented as usize; done requires a decided, documented API direction rather than only a local workaround.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi, thank you for this great library.

I encountered a problem when creating an ArrayView with a pointer and negative strides (see https://github.com/PyO3/rust-numpy/issues/151 for the full context).
We can do this by converting &[isize] to &[usize], but this causes panic by a debug assertion when building without --release flag.
So,

  • How about adding some unsafe API to do this? It would be like a public new_. I'm happy to create a PR if you're willing to.
  • Why are strides internally usize? It can be negative by slicing and I don't think it's reasonable to use usize.
Lenguaje dominante
Rust
Estrellas
4.3k
Forks
391
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rust-ndarray/ndarray

Todos los issues de rust-ndarray/ndarray

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.