BUG: matmul fails with zero-length broadcast batch dimensions
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 40/100
調査の方向性
Start in the recursive implementation of sparse.matmul and compare its batch handling with NumPy broadcasting for zero-sized dimensions. Reproduce the two examples in the issue, then add regression coverage for the listed rank, broadcasting, input type, dtype, and shape cases. Done when valid cases return NumPy-compatible shapes and invalid shapes still fail appropriately.
索引モデルが issue の本文から書いたものです。
説明
Bug
Batched sparse.matmul fails when a broadcast batch dimension is zero.
Reproduced on main at d63255057744331b96626a1f1c24504b3a3783cd.
import numpy as np
import sparse
a = sparse.COO.from_numpy(np.zeros((0, 2, 3)))
b = sparse.COO.from_numpy(np.zeros((0, 3, 4)))
sparse.matmul(a, b)
# ValueError: At least one array required.
a = sparse.COO.from_numpy(np.zeros((1, 2, 3)))
sparse.matmul(a, b)
# IndexError: Index is not smaller than dimension 0 >= 0
NumPy returns shape (0, 2, 4) in both cases. The recursive implementation either stacks an empty result list or iterates using max(1, 0), rather than the broadcast result size zero.
A focused empty-batch path and regression coverage are ready. The matrix exercises differing ranks, zero/singleton broadcasting, COO/GCXS/mixed dense inputs, dtype promotion and invalid contraction/batch shapes. Thirty-two new cases fail before the production change.
This is a different path from zero-length contracted axes in tensordot: the contracted dimension here is three and the failure happens in batch recursion.
This is an AI-assisted bug investigation with locally executed reproductions and tests. No assignment is requested.
- 主要言語
- Python
- スター
- 670
- フォーク
- 167
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pydata/sparse のほかの issue
-
Bug: full einsum contractions upcast the dtype and count booleans対応中かも @RaphaelFakhri が 17 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
BUG: ufunc outer rejects Python scalar and sequence operands対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
Bug: slices with a negative step and a negative stop return wrong elements対応中かも @JoeyTan21 が 19 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
pydata/sparse#1019 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
BUG: zero-length tensor contractions ignore requested output types対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
BUG: inferred COO reshape dimensions lose integer precision対応中かも @nawaaaaaAaar が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
abetlen/llama-cpp-python#2424 ·
メンテナーはふだん 1 日以内に返信
-
Bug IronPython Python 3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pyrevitlabs/pyRevit#4184 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信