Skip to content

Commit

Permalink
Move constructor outside
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack committed Dec 23, 2023
1 parent ff2384e commit d9af3f2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/ParameterSchedulers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,15 @@ mutable struct Scheduler{T, O, F} <: Flux.Optimise.AbstractOptimiser
schedule::T
optim::O
update_func::F

function Scheduler{T, O, F}(state::IdDict{Any, Int},
schedule::T,
optim::O,
update_func::F) where {T, O, F}
@warn """Scheduler will transition to explicit Optimisers.jl style
optimizers in the next release""" _id=(:scheduler) maxlog=1

return new{T, O, F}(state, schedule, optim, update_func)
end
end
function Scheduler{T, O, F}(state::IdDict{Any, Int},
schedule::T,
optim::O,
update_func::F) where {T, O, F}
@warn """Scheduler will transition to explicit Optimisers.jl style
optimizers in the next release""" _id=(:scheduler) maxlog=1

return Scheduler{T, O, F}(state, schedule, optim, update_func)
end
Scheduler(schedule, opt, update_func) =
Scheduler(IdDict{Any, Int}(), schedule, opt, update_func)
Expand Down

0 comments on commit d9af3f2

Please sign in to comment.