forward_diff_no_inf can't handle throw_undef_if_not
还没有人认领这个 Issue。
评估
调研方向
从 forward_diff_no_inf! 的实现开始,并检查 forward_visit 中由 throw_undef_if_not 生成的 IR 节点。使用 identity_transform! 回调重现提供的 phi_run 示例;当调用在没有当前错误的情况下完成,并且相关节点得到一致处理时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Ran into this while trying to reproduce another bug.
The following code errors:
using Diffractor
# this is needed as transform! is *always* called on Arguments regardless of what visit_custom says
identity_transform!(ir, ssa::Core.SSAValue, order) = ir[ssa]
function identity_transform!(ir, arg::Core.Argument, order)
return Core.Compiler.insert_node!(ir, Core.SSAValue(1), Core.Compiler.NewInstruction(Expr(:call, Diffractor.ZeroBundle{1}, arg), Any))
end
function phi_run(x::Float64, b1::Bool, b2::Bool)
if b1
a = 0.
elseif b2
a = z
end
return x - a
end
input_ir = first(only(Base.code_ircode(phi_run, Tuple{Float64, Bool, Bool})))
Diffractor.forward_diff_no_inf!(copy(input_ir), Core.SSAValue.(1:length(input_ir.stmts)) .=> 1; transform! = identity_transform!)
I think the fix is easy, add the case to forward_visit about what to do for this kind of node.
Which i think is return nothing
- 主要语言
- Julia
- 星标
- 453
- 派生
- 33
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaDiff/Diffractor.jl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 25/100
JuliaDiff/Diffractor.jl#302 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 52/100
JuliaDiff/Diffractor.jl#294 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
JuliaDiff/Diffractor.jl#293 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
JuliaDiff/Diffractor.jl#290 · 8 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
JuliaDiff/Diffractor.jl#280 · 1 条评论 ·
查看 JuliaDiff/Diffractor.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 天内回复