Merge pull request #471 from FluxML/kf/broadcastvcheck

Add VERSION check around broadcast piracy
This commit is contained in:
Mike J Innes 2018-10-29 15:20:10 +00:00 committed by GitHub
commit 59cfe3e891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -434,7 +434,8 @@ end
using Requires using Requires
# https://github.com/FluxML/Flux.jl/issues/353 # https://github.com/FluxML/Flux.jl/issues/353
@init Requires.isprecompiling() || @eval Base.Broadcast begin if VERSION < v"1.1.0-DEV.548"
@init Requires.isprecompiling() || @eval Base.Broadcast begin
function flatten(bc::Broadcasted{Style}) where {Style} function flatten(bc::Broadcasted{Style}) where {Style}
isflat(bc) && return bc isflat(bc) && return bc
args = cat_nested(bc) args = cat_nested(bc)
@ -458,4 +459,5 @@ using Requires
end end
end end
end end
end
end end