-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define a bunch of zero_tangents that should just NoTangent #662
Conversation
zero_tangent(::Core.Compiler.AbstractInterpreter) = NoTangent() | ||
zero_tangent(::Core.Compiler.InstructionStream) = NoTangent() | ||
zero_tangent(::Core.CodeInfo) = NoTangent() | ||
zero_tangent(::Core.MethodInstance) = NoTangent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
zero_tangent(::Core.MethodInstance) = NoTangent() | |
zero_tangent(::Core.MethodInstance) = NoTangent() |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #662 +/- ##
==========================================
- Coverage 94.26% 93.80% -0.47%
==========================================
Files 15 15
Lines 977 985 +8
==========================================
+ Hits 921 924 +3
- Misses 56 61 +5 ☔ View full report in Codecov by Sentry. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
… that constructable
test/tangent_types/abstract_zero.jl
Outdated
zero_tangent(Dict{Int, Float64}(1=>2.4)), | ||
Tangent{Dict{Int,Float64}}(Dict{Int, Float64}()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
zero_tangent(Dict{Int, Float64}(1=>2.4)), | |
Tangent{Dict{Int,Float64}}(Dict{Int, Float64}()) | |
zero_tangent(Dict{Int,Float64}(1 => 2.4)), | |
Tangent{Dict{Int,Float64}}(Dict{Int,Float64}()), |
test/tangent_types/abstract_zero.jl
Outdated
zero_tangent(Base.PersistentDict(1=>2.4)), | ||
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
zero_tangent(Base.PersistentDict(1=>2.4)), | |
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}()) | |
zero_tangent(Base.PersistentDict(1 => 2.4)), | |
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int,Float64}()), |
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}()) | ||
) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
zero_tangent(Dict{Int, Float64}(1 => 2.4)), | ||
Tangent{Dict{Int,Float64}}(Dict{Int, Float64}()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
zero_tangent(Dict{Int, Float64}(1 => 2.4)), | |
Tangent{Dict{Int,Float64}}(Dict{Int, Float64}()) | |
zero_tangent(Dict{Int,Float64}(1 => 2.4)), | |
Tangent{Dict{Int,Float64}}(Dict{Int,Float64}()), |
if isdefined(Base, :PersistentDict) | ||
@test ==( | ||
zero_tangent(Base.PersistentDict(1 => 2.4)), | ||
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int, Float64}()) | |
Tangent{Base.PersistentDict{Int,Float64}}(Dict{Int,Float64}()), |
I do vaguely wonder if we should just preemptively walk things and if we don't find an AbstractFloat element always return
NoTangent
.But for now I am just marking a bunch of stuff that has no tangent space as
zero_tangent(x)=NoTangent()
Also fixes
AbstractDict
though we have never properly implemented dict support in AD.