Skip to content

Commit 79c2cf8

Browse files
committed
StateCacher should be fine with default pickle protocol
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent 77d2d82 commit 79c2cf8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/utils/test_state_cacher.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727
TEST_CASE_0 = [torch.Tensor([1]).to(DEVICE), {"in_memory": True}]
2828
TEST_CASE_1 = [
2929
torch.Tensor([1]).to(DEVICE),
30-
{"in_memory": False, "cache_dir": gettempdir(), "pickle_module": None, "pickle_protocol": pickle.HIGHEST_PROTOCOL},
30+
{
31+
"in_memory": False,
32+
"cache_dir": gettempdir(),
33+
"pickle_module": None,
34+
# TODO: was pickle.HIGHEST_PROTOCOL but this wasn't compatible with torch.load, need to improve compatibility
35+
"pickle_protocol": torch.serialization.DEFAULT_PROTOCOL,
36+
},
3137
]
3238
TEST_CASE_2 = [torch.Tensor([1]).to(DEVICE), {"in_memory": False, "allow_overwrite": False}]
3339
TEST_CASE_3 = [torch.Tensor([1]).to(DEVICE), {"in_memory": False, "cache_dir": Path(gettempdir())}]

0 commit comments

Comments
 (0)