diff options
author | Roma Klapaukh <rklapaukh@hotmail.com> | 2024-02-06 18:50:55 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 08:50:55 +0100 |
commit | 1ba11f22d68a26f34e226490900640d06996a5f4 (patch) | |
tree | 4f3583bcea2751ec3d25bab1d60d08e31cd13905 /candle-core/tests/pth.py | |
parent | 982722019b2b844dc27878cfa31b4af7dcacacc5 (diff) | |
download | candle-1ba11f22d68a26f34e226490900640d06996a5f4.tar.gz candle-1ba11f22d68a26f34e226490900640d06996a5f4.tar.bz2 candle-1ba11f22d68a26f34e226490900640d06996a5f4.zip |
Fix: pth files don't load on Windows (#1661)
* Don't treat zip path as OS path
* Add a test case
* Add code to generate test pth data
Diffstat (limited to 'candle-core/tests/pth.py')
-rw-r--r-- | candle-core/tests/pth.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/candle-core/tests/pth.py b/candle-core/tests/pth.py new file mode 100644 index 00000000..97724712 --- /dev/null +++ b/candle-core/tests/pth.py @@ -0,0 +1,8 @@ +import torch +from collections import OrderedDict + +# Write a trivial tensor to a pt file +a= torch.tensor([[1,2,3,4], [5,6,7,8]]) +o = OrderedDict() +o["test"] = a +torch.save(o, "test.pt") |