Fixes and follow-ups to two-sided broadcasting in arithmethic ops

Offen
#936 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
20/100
Issue-Typ
Refactoring
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
rust
Bereich
data

Rechercherichtung

Start by reviewing the two-sided broadcasting changes in issue #898 and the arithmetic-operation code they introduced. Work through each unchecked follow-up—trait bounds, allocation preservation for Array + Array, and a possible public broadcasting API—and confirm the relevant behavior and API decisions before considering the issue complete.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

In #898 we left the following "known issues" open that we can fix after that PR's review and merge:

  • Rename BroadcastShape to DimMax - we also move the broadcast method out of the trait (it can just be a free function)
  • It is a wish that the D: Dimension + DimMax<E> bound in arith ops becomes just D: Dimension, i.e. the DimMax with associated type becomes implied by D: Dimension. At this point it is not certain how this can be done.
  • Preserve the allocation of the input array in arithmetic ops in more cases (when only the left/right side needs broadcast) in array + &array and &array + array
  • Preserve the allocation of the input array in arithmetic ops in more cases (when the left side needs broadcast in Array + Array)
  • Improve performance of "no-broadcasting-needed" scenario in &array + &array operation
  • Potentially provide public function or method similar to broadcast_with - that does the broadcasting of two arrays together.
Vorherrschende Sprache
Rust
Sterne
4.3k
Forks
391
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rust-ndarray/ndarray

Alle Issues in rust-ndarray/ndarray

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.