Skip to content

Commit 383b5d9

Browse files
kit1980facebook-github-bot
authored andcommitted
Use weights_only for load (#3796)
Summary: `torch.load` without `weights_only` parameter is unsafe. Explicitly set `weights_only` to False only if you trust the data you load and full pickle functionality is needed, otherwise set `weights_only=True`. If `weights_only=True` doesn't work for some cases, then explicit `weights_only=False` should be used. Found with https://github.com/pytorch-labs/torchfix/ Pull Request resolved: #3796 Reviewed By: asadoughi Differential Revision: D61824340 Pulled By: kit1980 fbshipit-source-id: bc013d06d4f368f730ffee6898e75fd0b0ff1d40
1 parent 95e0a66 commit 383b5d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demos/demo_qinco.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
with torch.no_grad():
3838

39-
qinco = torch.load("/tmp/bigann_8x8_L2.pt")
39+
qinco = torch.load("/tmp/bigann_8x8_L2.pt", weights_only=False)
4040
qinco.eval()
4141
# print(qinco)
4242
if True:

0 commit comments

Comments
 (0)