diff options
author | Dilshod Tadjibaev <939125+antimora@users.noreply.github.com> | 2024-02-06 14:17:33 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 21:17:33 +0100 |
commit | b75e8945bc7c67106be6288b9f357efa8068e62e (patch) | |
tree | e9918bcacc07281358f0ecfa66fa700278980cb1 /candle-core/tests/pth.py | |
parent | a90fc5ca5a486e988d39ea69ee3d3bb40a39c017 (diff) | |
download | candle-b75e8945bc7c67106be6288b9f357efa8068e62e.tar.gz candle-b75e8945bc7c67106be6288b9f357efa8068e62e.tar.bz2 candle-b75e8945bc7c67106be6288b9f357efa8068e62e.zip |
Enhance pickle to retrieve state_dict with a given key (#1671)
Diffstat (limited to 'candle-core/tests/pth.py')
-rw-r--r-- | candle-core/tests/pth.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/candle-core/tests/pth.py b/candle-core/tests/pth.py index 97724712..cab94f2c 100644 --- a/candle-core/tests/pth.py +++ b/candle-core/tests/pth.py @@ -6,3 +6,5 @@ a= torch.tensor([[1,2,3,4], [5,6,7,8]]) o = OrderedDict() o["test"] = a torch.save(o, "test.pt") + +torch.save({"model_state_dict": o}, "test_with_key.pt") |