Skip to content
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

Merged
merged 3 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "1.9"
version = "1.9.1"
oxinabox marked this conversation as resolved.
Show resolved Hide resolved

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
1 change: 1 addition & 0 deletions src/rulesets/Base/nondiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
@non_differentiable Vector(::AbstractArray{Bool})

@non_differentiable Array(::AbstractArray{Bool})
@non_differentiable BitArray(::Any)
Copy link
Member

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...)

Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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!

@non_differentiable IndexStyle(::AbstractArray{Bool})

#####
Expand Down