RFC: `linalg.outer` support batches of vectors
还没有人认领这个 Issue。
评估
调研方向
从链接的 linalg.outer 规范开始,查看 issue 中引用的 PyTorch 和 NumPy 行为,然后阅读 pytorch/pytorch#63293 中的讨论。当 Array API 社区就批量输入语义达成一致,并相应更新 linalg.outer 规范后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.outerwhich 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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
data-apis/array-api 的其他 Issue
-
bug Maintenance Narrative Content
难度 1/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 5/5 一周以上 新手友好度 35/100
-
Maintenance
-
难度 5/5 一周以上 新手友好度 25/100
查看 data-apis/array-api 的全部 Issue
相似的 Issue
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
难度 1/5 1 小时以内 新手友好度 88/100
NousResearch/hermes-agent#132042 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
deepset-ai/haystack#13092 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
EverMind-AI/Raven#845 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
AstrBotDevs/AstrBot#10340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
BasedHardware/omi#20401 · 1 条评论 ·
维护者通常 1 天内回复