Skip to content

Commit

Permalink
Remove broadcast-related ambiguity with Params
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir authored Dec 31, 2023
1 parent c8fe70d commit 2cd611e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function Base.delete!(ps::Params, x)
return ps
end

Base.Broadcast.broadcasted(f, ps::Params) = broadcasted(f, ps.order)
Base.Broadcast.broadcastable(ps::Params) = ps.order

@adjoint function Broadcast.broadcasted(f::Function, ps::Params)
f.(ps), _ -> throw(ArgumentError("Zygote.Params does not support broadcasting within gradients, try iteration `for p in ps`"))
Expand Down

0 comments on commit 2cd611e

Please sign in to comment.