Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RFC: `linalg.outer` support batches of vectors

オープン
#242 コメント 5 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
numpy, pytorch
領域
api

調査の方向性

リンクされている linalg.outer の仕様から始め、issue で引用されている PyTorch と NumPy の動作を確認してから、pytorch/pytorch#63293 の議論を読んでください。Array API コミュニティがバッチ入力のセマンティクスに合意し、それに応じて linalg.outer の仕様を更新すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
281
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

data-apis/array-api のほかの issue

data-apis/array-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。