ArrayPartition `A[:]` throws DimensionMismatch
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
Look at the indexing code in RecursiveArrayTools.jl, especially the handling of colon : after PR #239. Start by checking the getindex method for ArrayPartition and see how it processes (colon, j...). The failing test case is v = ArrayPartition([1.0, 2.0], [3.0]); v[:]. Compare with vec(v) which works. The fix should make v[:] return the flattened vector [1.0, 2.0, 3.0] without a DimensionMismatch.
由索引模型根据 Issue 内容生成。
描述
A[:] on an ArrayPartition throws instead of returning the flattened vector. This happens for every partition I tried, including ones built from plain vectors:
using RecursiveArrayTools # v4.5.2 (the latest release), Julia 1.12.4
v = ArrayPartition([1.0, 2.0], [3.0])
v[:]
ERROR: DimensionMismatch: arrays could not be broadcast to a common size: a has axes Base.OneTo(2) and b has axes Base.OneTo(0)
The same happens with matrix parts, e.g. ArrayPartition(rand(1,2), rand(1,3))[:]. Range indexing works (v[1:3] == [1.0, 2.0, 3.0]), and so does vec(v) / collect(v). Only the colon path fails. A[:] was the suggested workaround in https://github.com/SciML/RecursiveArrayTools.jl/issues/52, so it used to work. A reproduction worker traced it to the (colon, j...) indexing change in https://github.com/SciML/RecursiveArrayTools.jl/pull/239, but I have not bisected it, so treat that as a lead, not a result.
Expected: v[:] == [1.0, 2.0, 3.0].
🤖 Posted by an AI agent (Claude Code, model claude-opus-5-5[1m]) on behalf of Chris Rackauckas. Session: https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP
- 主要语言
- Julia
- 星标
- 234
- 派生
- 77
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SciML/RecursiveArrayTools.jl 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
SciML/RecursiveArrayTools.jl#255 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
SciML/RecursiveArrayTools.jl#680 ·
维护者通常 3 天内回复
-
ArrayPartition of GPU arrays: norm, dot, Vector, any scalar-index; no KernelAbstractions.get_backend未关闭
难度 4/5 3-5 天 新手友好度 45/100
SciML/RecursiveArrayTools.jl#676 ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 67/100
SciML/RecursiveArrayTools.jl#675 ·
维护者通常 3 天内回复
-
难度 4/5 1-2 天 新手友好度 57/100
SciML/RecursiveArrayTools.jl#674 ·
维护者通常 3 天内回复
查看 SciML/RecursiveArrayTools.jl 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Truncated discrete ccdf and logccdf return incorrect values at the lower atom可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
JuliaStats/Distributions.jl#2095 ·
-
documentation 📜 microphysics💧 ❄️
难度 2/5 1-3 小时 新手友好度 63/100
NumericalEarth/Breeze.jl#1073 ·
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
CliMA/ClimaAtmos.jl#4891 · 1 条评论 ·
维护者通常 1 天内回复