RFC: `linalg.outer` support batches of vectors

Aperta
#242 5 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
numpy, pytorch
Ambito
api

Direzione di ricerca

Inizia con la specifica collegata di linalg.outer e analizza il comportamento di PyTorch e NumPy citato nell’issue, quindi leggi la discussione in pytorch/pytorch#63293. Il lavoro è completato quando la community di Array API avrà concordato la semantica degli input con batch e avrà aggiornato di conseguenza la specifica di linalg.outer.

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

Descrizione

API change RFC status: Blocked topic: Linear Algebra

Current Status

Current API spec defines the linalg.outer behaviour for one-dimensional vector inputs only.

Quoting from the docs.

Computes the outer product of two vectors x1 and x2 .
Parameters

  • x1 :
    • first one-dimensional input array of size N . Should have a numeric data type.
  • x2 :
    • second one-dimensional input array of size M . Should have a numeric data type.

Proposal

Most of the array/tensor libraries involve the manipulation and usage of batched vectors. It would be worth considering batch support in linalg.outer for the Array API standard, instead of only the 1D Vectors. This will also make linalg.outer more in line with the behaviour offered by other linalg functions in the spec which generally take in an nd-array/tensor.


Interestingly

  • PyTorch currently has torch.outer which also only supports 1d Tensors.
  • NumPy though supports nd-arrays with numpy.outer, but the behaviour is to flatten the inputs to 1d Vectors in case the input is not already 1-dimensional.

This was initially discussed in pytorch/pytorch#63293.

cc @Lezcano @rgommers

Lingua principale
Python
Stelle
281
Fork
52
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di data-apis/array-api

Tutte le issue di data-apis/array-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.