Assumption handler for Eye fails on a Blockwise Eye: unpacks batched output shape
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
Start with pytensor/assumptions/selection.py and the _eye handler; compare its shape unpacking with the delegation in pytensor/assumptions/blockwise.py. Reproduce the issue with the vectorized example in the report, then check that compiling it no longer logs the rewrite failure. Pull request #2688 is already open against this issue.
由索引模型根据 Issue 内容生成。
描述
Compiling a vectorized graph that adds pt.identity_like to a matrix before cholesky and cho_solve logs a rewrite failure from orthogonal_solve_to_transpose_matmul. The Blockwise handler in pytensor/assumptions/blockwise.py hands the batched node to the core Eye handler, _eye. That handler does rows, cols = node.outputs[0].type.shape, which raises ValueError on the 3D output.
import pytensor
import pytensor.tensor as pt
def jittered_cho_solve(F, v):
L = pt.linalg.cholesky(F + pt.identity_like(F) * 1e-8)
return pt.linalg.cho_solve((L, True), v)
F = pt.tensor("F", shape=(4, 2, 2))
v = pt.tensor("v", shape=(4, 2))
out = pt.vectorize(jittered_cho_solve, signature="(p,p),(p)->(p)")(F, v)
pytensor.function([F, v], out) # logs "Rewrite failure due to: orthogonal_solve_to_transpose_matmul"
traceback
Rewrite failure due to: orthogonal_solve_to_transpose_matmul
node: Blockwise{CholeskySolve{lower=True, b_ndim=1, overwrite_b=False}, (m,m),(m)->(m)}(Blockwise{Cholesky{lower=True, overwrite_a=False}, (m,m)->(m,m)}.0, v)
TRACEBACK:
Traceback (most recent call last):
...
File ".../pytensor/assumptions/blockwise.py", line 11, in _blockwise_delegate
return infer_assumption_for_node(
File ".../pytensor/assumptions/core.py", line 411, in infer_assumption_for_node
output_states = fn(key, op, feature, fgraph, node, input_states)
File ".../pytensor/assumptions/selection.py", line 89, in _eye
rows, cols = node.outputs[0].type.shape
ValueError: too many values to unpack (expected 2, got 3)
- 主要语言
- Python
- 星标
- 654
- 派生
- 258
- 平均合并
- 3 天 41 分钟
- 30 天内合并 PR
- 42
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pymc-devs/pytensor 的其他 Issue
-
Docs of mode still mentions C/CVM as the default with FAST_RUN可能已有人在做 @ADITYASINGH1206 于 8 天前认领。 未关闭docs
难度 2/5 1-3 小时 新手友好度 62/100
pymc-devs/pytensor#2641 · 1 条评论 ·
维护者通常 1 天内回复
-
docs
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
BUG: geomspace returns wrong sign for the endpoints when start and stop are negative可能已有人在做 @mayuriphad 于 27 天前认领。 未关闭
难度 2/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
Reciprocal.impl computes np.float32(1.0) / x: float32 precision for float64 scalars under NEP 50 (Python linker)可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
pymc-devs/pytensor#2430 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
pymc-devs/pytensor#2428 · 5 条评论 ·
维护者通常 1 天内回复
查看 pymc-devs/pytensor 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
pathintegral-institute/mcpm.sh#568 ·
维护者通常 21 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
invarislabs/invaris-agentsec#98 ·
维护者通常 1 天内回复
-
5-minutes beginner-friendly documentation good first issue hacktoberfest help wanted no-code-needed python
难度 1/5 1 小时以内 新手友好度 65/100
Huerte/algo-solutions-python#364 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
Becksteinlab/imdclient#161 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复