From d6d0067db4569307c15099fc537a2c8efb8bd22f Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Sat, 20 May 2023 15:17:59 +0200 Subject: [PATCH] cl/depr (#58) --- Project.toml | 2 +- src/deprecated.jl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0d04dd6..ed9e81f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Tsunami" uuid = "36e41bbe-399b-4a86-8623-faa02b4c2ac8" authors = "Carlo Lucibello" -version = "0.2.0" +version = "0.1.4" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/deprecated.jl b/src/deprecated.jl index e69de29..ede392a 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -0,0 +1,9 @@ +function fit(ckpt_path::AbstractString, trainer::Trainer, args...; kws...) + Base.depwarn("`fit(ckpt_path, trainer, ...)` is deprecated, use `fit(ckpt_path, model, trainer, ...; kws...)` instead.", :fit) + ckpt = load_checkpoint(ckpth_path) + model = ckpt.model + trainer.fit_state = ckpt.fit_state + trainer.lr_schedulers = ckpt.lr_schedulers + trainer.optimisers = ckpt.optimisers + return fit(model, trainer, args...; kws..., _resuming_from_ckpt = true) +end