`searchsorted` needs to broadcast batch shapes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by locating the searchsorted implementation and its tests; the issue provides a reproducer for the failing case where x has shape (2, 5) and y has shape (5,). Read how the function handles batch dimensions, then run the relevant tests with this case. Done means the batch shapes broadcast and the call succeeds with the expected indices.
索引モデルが issue の本文から書いたものです。
説明
Ran into this in scipy/scipy#26324:
import numpy as np
from scipy._external import array_api_extra as xpx
rng = np.random.default_rng(2398198374572881)
shape_1d = (5,)
shape_2d = (2, 5)
x = np.sort(rng.random(shape_1d), axis=-1)
y = rng.random(shape_2d)
xpx.searchsorted(x, y) # OK
x = np.sort(rng.random(shape_2d), axis=-1)
y = rng.random(shape_1d)
xpx.searchsorted(x, y) # not OK
# ValueError: input operand has more dimensions than allowed by the axis remapping
My workaround there was to broadcast the batch shapes (e.g. batch_shape = xp.broadcast_shapes(x1.shape[:-1], x2.shape[:-1])) and reshape the arguments accordingly.
- 主要言語
- Python
- スター
- 33
- フォーク
- 33
- 平均マージ
- 1時間 16分
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
data-apis/array-api-extra のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
data-apis/array-api-extra#1005 · コメント 15 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement new function
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
data-apis/array-api-extra#992 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 52/100
data-apis/array-api-extra#1011 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ENH, TST: Add support for MLX as array backend対応中かも @prady0t が 5 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
data-apis/array-api-extra#1006 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
data-apis/array-api-extra#1002 ·
メンテナーはふだん 1 日以内に返信
data-apis/array-api-extra の issue をすべて見る
似ている issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
ansys/pydpf-core#3547 ·
メンテナーはふだん 1 日以内に返信
-
core
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vectorize-io/hindsight#5457 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: LangChain drops OpenAI Responses text blocks from session recording対応中かも @ktz03 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
volcengine/OpenViking#5806 ·
メンテナーはふだん 1 日以内に返信
-
HTML: <template> content is extracted as document text対応中かも @ryanmeowy が今日担当しました。 オープンbug html
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
docling-project/docling#4714 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
APIv2 event data accepts a non-string reply and a NaN upper_bound対応中かも @awss1i が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
freedomofpress/securedrop#7946 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信