-
Notifications
You must be signed in to change notification settings - Fork 89
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
do not differentiate through the construction of BitArray #506
Conversation
Cool, LGTM. Sometimes we test them, if we have had them defined wrong in the past. |
Will merge once CI passes. |
cool, Thanks a lot! |
@@ -84,6 +84,7 @@ | |||
@non_differentiable Vector(::AbstractArray{Bool}) | |||
|
|||
@non_differentiable Array(::AbstractArray{Bool}) | |||
@non_differentiable BitArray(::Any) |
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.
Is there a reason we didn't splat this?
@non_differentiable BitArray(::Any...)
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.
Doesn't it only have 1 constructor?
I didn't actually check
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.
julia> methods(BitArray)
# 6 methods for type constructor:
[1] BitArray(::UndefInitializer, dims::Integer...) in Base at bitarray.jl:69
[2] BitArray(::UndefInitializer, dims::Tuple{Vararg{Integer, N}}) where N in Base at bitarray.jl:71
[3] BitArray(x::BitArray) in Base at bitarray.jl:543
[4] BitArray(A::AbstractArray{var"#s79", N} where var"#s79") where N in Base at bitarray.jl:503
[5] (::Type{T})(x::T) where T<:BitArray in Base at bitarray.jl:542
[6] BitArray(itr) in Base at bitarray.jl:574
there seems to be more
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.
Should I make another PR?
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.
Please do, that would be great, thanks!
Based on @oxinabox 's reply here: SciML/DiffEqFlux.jl#502 (comment) .
This solves also the issues with the callback construction in SciML/DiffEqFlux.jl#502.
Does it need a test? Should I maybe add one from SciML/DiffEqFlux.jl#502 (comment) in here: https://github.com/JuliaDiff/ChainRules.jl/blob/master/test/rulesets/Base/array.jl ?