You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytorch/test-infra#4671 added linter-only
`TorchUnsafeLoadVisitor`, but it turned out that the issue is so
widespread that manual fixes would be tedious.
The codemod is somewhat unsafe correctness-wise because full pickling
functionality may still be needed even without `pickle_module`, but I
think it's OK because it fixes a security-related issue and the codemods
need to be verified anyway.
Maybe later we should add something like Ruff's recently added
`--unsafe-fixes`: https://docs.astral.sh/ruff/linter/#fix-safety
I used this for pytorch/vision#8105
4:1 TOR102 `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`.
1
+
6:1 TOR102 `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`.
2
+
7:1 TOR102 `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`.
0 commit comments