From cdc3823d8fd71c5cc8aed3bef1f70291b81d6e8a Mon Sep 17 00:00:00 2001 From: Laurent Mazare Date: Thu, 8 Feb 2024 13:09:49 +0100 Subject: [PATCH] Pickle support: dig within the _rebuild_parameter calls. (#1681) --- candle-core/src/pickle.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/candle-core/src/pickle.rs b/candle-core/src/pickle.rs index c7b9e434..f6d80830 100644 --- a/candle-core/src/pickle.rs +++ b/candle-core/src/pickle.rs @@ -217,6 +217,13 @@ impl Object { let args = args.remove(1); (callable, args) } + Object::Class { + module_name, + class_name, + } if module_name == "torch._utils" && class_name == "_rebuild_parameter" => { + let mut args = args.tuple()?; + args.remove(0).reduce()? + } _ => (callable, args), }; match callable {