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

Method ambiguities reported by Aqua #1484

Open
prbzrg opened this issue Dec 27, 2023 · 0 comments
Open

Method ambiguities reported by Aqua #1484

prbzrg opened this issue Dec 27, 2023 · 0 comments
Labels
implicit using Params, Grads

Comments

@prbzrg
Copy link

prbzrg commented Dec 27, 2023

In Julia v1.10, I used Aqua to detect method ambiguities in my package impICNF/ContinuousNormalizingFlows.jl#356 and some of its report were related to this package:

Ambiguity #44
broadcasted(f, gs::Zygote.Grads, a::Union{AbstractArray{<:T}, T} where T<:Number) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:381
broadcasted(::Base.Broadcast.AndAnd, a, b) @ Base.Broadcast broadcast.jl:196

Possible fix, define
  broadcasted(::Base.Broadcast.AndAnd, ::Zygote.Grads, ::Union{AbstractArray{<:T}, T} where T<:Number)

Ambiguity #45
broadcasted(f, gs::Zygote.Grads, gss::Union{Zygote.Grads, AbstractDict}...) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:378
broadcasted(style::Base.Broadcast.BroadcastStyle, f::F, args...) where F @ Base.Broadcast broadcast.jl:1349

Possible fix, define
  broadcasted(::Base.Broadcast.BroadcastStyle, ::Zygote.Grads, ::Vararg{Union{Zygote.Grads, AbstractDict}})

Ambiguity #46
broadcasted(f, a::Union{AbstractArray{<:T}, T} where T<:Number, gs::Zygote.Grads) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:380
broadcasted(style::Base.Broadcast.BroadcastStyle, f::F, args...) where F @ Base.Broadcast broadcast.jl:1349

Possible fix, define
  broadcasted(::Base.Broadcast.BroadcastStyle, ::F, ::Zygote.Grads) where F<:(Union{AbstractArray{<:T}, T} where T<:Number)

Ambiguity #47
broadcasted(f, gs::Zygote.Grads, a::Union{AbstractArray{<:T}, T} where T<:Number) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:381
broadcasted(::Base.Broadcast.OrOr, a, b) @ Base.Broadcast broadcast.jl:203

Possible fix, define
  broadcasted(::Base.Broadcast.OrOr, ::Zygote.Grads, ::Union{AbstractArray{<:T}, T} where T<:Number)

Ambiguity #48
broadcasted(f, a::Union{AbstractArray{<:T}, T} where T<:Number, gs::Zygote.Grads) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:380
broadcasted(::Base.Broadcast.OrOr, a, b) @ Base.Broadcast broadcast.jl:203

Possible fix, define
  broadcasted(::Base.Broadcast.OrOr, ::Union{AbstractArray{<:T}, T} where T<:Number, ::Zygote.Grads)

Ambiguity #49
broadcasted(f, gs::Zygote.Grads, gss::Union{Zygote.Grads, AbstractDict}...) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:378
broadcasted(::Base.Broadcast.AndAnd, a, b) @ Base.Broadcast broadcast.jl:196

Possible fix, define
  broadcasted(::Base.Broadcast.AndAnd, ::Zygote.Grads, ::Union{Zygote.Grads, AbstractDict})

Ambiguity #50
broadcasted(f, a::Union{AbstractArray{<:T}, T} where T<:Number, gs::Zygote.Grads) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:380
broadcasted(::Base.Broadcast.AndAnd, a, b) @ Base.Broadcast broadcast.jl:196

Possible fix, define
  broadcasted(::Base.Broadcast.AndAnd, ::Union{AbstractArray{<:T}, T} where T<:Number, ::Zygote.Grads)

Ambiguity #52
broadcasted(f, ps::Zygote.Params) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:260
broadcasted(style::Base.Broadcast.BroadcastStyle, f::F, args...) where F @ Base.Broadcast broadcast.jl:1349

Possible fix, define
  broadcasted(::Base.Broadcast.BroadcastStyle, ::F) where F<:Zygote.Params

Ambiguity #53
broadcasted(f, gs::Zygote.Grads, a::Union{AbstractArray{<:T}, T} where T<:Number) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:381
broadcasted(style::Base.Broadcast.BroadcastStyle, f::F, args...) where F @ Base.Broadcast broadcast.jl:1349

Possible fix, define
  broadcasted(::Base.Broadcast.BroadcastStyle, ::Zygote.Grads, ::Union{AbstractArray{<:T}, T} where T<:Number)

Ambiguity #54
broadcasted(f, gs::Zygote.Grads, gss::Union{Zygote.Grads, AbstractDict}...) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:378
broadcasted(::Base.Broadcast.OrOr, a, b) @ Base.Broadcast broadcast.jl:203

Possible fix, define
  broadcasted(::Base.Broadcast.OrOr, ::Zygote.Grads, ::Union{Zygote.Grads, AbstractDict})

Ambiguity #85
map(::typeof(Zygote._project), args::Tuple{Zygote.Params}, grad) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:217
map(f, t::Tuple, s::Tuple) @ Base tuple.jl:320

Possible fix, define
  map(::typeof(Zygote._project), ::Tuple{Zygote.Params}, ::Tuple)

Ambiguity #86
map(::typeof(Zygote._project), args::Tuple{Zygote.Params}, grad) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:217
map(f, t1::Tuple, t2::Tuple, ts::Tuple...) @ Base tuple.jl:339

Possible fix, define
  map(::typeof(Zygote._project), ::Tuple{Zygote.Params}, ::Tuple)

Ambiguity #87
map(::typeof(Zygote._project), args::Tuple{Zygote.Params}, grad) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:217
map(f, t::Tuple{Any}, s::Tuple{Any}) @ Base tuple.jl:318

Possible fix, define
  map(::typeof(Zygote._project), ::Tuple{Zygote.Params}, ::Tuple{Any})

Ambiguity #88
map(::typeof(Zygote._project), args::Tuple{Zygote.Params}, grad) @ Zygote ~/.julia/packages/Zygote/WOy6z/src/compiler/interface.jl:217
map(f, t::Tuple, s::Tuple{}) @ Base tuple.jl:316

Possible fix, define
  map(::typeof(Zygote._project), ::Tuple{Zygote.Params}, ::Tuple{})

I would appreciate your attention to this issue.

ToucheSir added a commit that referenced this issue Dec 31, 2023
As far as I can tell, these were never used, tested or documented.
Moreover, they don't make sense semantically since `Grads` behaves like a Dict rather than an ordinal-indexed collection like an Array.
Meanwhile, their continued existence is causing issues like #1484.
@ToucheSir ToucheSir added the implicit using Params, Grads label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implicit using Params, Grads
Projects
None yet
Development

No branches or pull requests

2 participants