Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Not using "strong zeros" for deriatives of constant values

未关闭
#278 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
julia
领域
compilers

调研方向

从 Diffractor.PrimeDerivativeFwd 开始,检查 Julia REPL 示例中所示的 exp 导数对应的 code_typed 输出。当 exp''(Inf) 产生 Inf 而不是 NaN,与 Zygote 的比较结果一致,并保留所描述的 strong-zero 行为时,该 issue 即完成。

由索引模型根据 Issue 内容生成。

描述

Compare:

julia> using Diffractor, Zygote

julia> var"'"(f) = Zygote.var"'"(f);

julia> exp'(Inf)
Inf

julia> exp''(Inf)
Inf

with

julia> var"'"(f) = Diffractor.PrimeDerivativeFwd(f);

julia> exp'(Inf)
Inf

julia> exp''(Inf)
NaN

You can see in the code_typed that it appears to be subtracting 0.0 * exp(x)^2 from the answer of 1.0 * exp(x), causing the NaN. Ideally this'd instead be 1.0 * exp(x) - ZeroTangent()*exp(x)^2 so that we don't get the NaN.

主要语言
Julia
星标
453
派生
33
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaDiff/Diffractor.jl 的其他 Issue

查看 JuliaDiff/Diffractor.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。