MEDIUM5.3
PYSEC-2025-202
Quick fix
PYSEC-2025-202 — torch: upgrade to the fixed version with the command below.
pip install --upgrade 'torch>=2.7.0'Details
PyTorch before 3.7.0 has a bernoulli_p decompose function in decompositions.py even though it lacks full consistency with the eager CPU implementation, negatively affecting nn.Dropout1d, nn.Dropout2d, and nn.Dropout3d for fallback_random=True.
Are you affected?
Enter the version of the package you're using.
Affected packages
References
- https://github.com/pytorch/pytorch/compare/v2.6.0...v2.7.0[WEB]
- https://gist.github.com/shaoyuyoung/4bcefba4004f8271e64b5185c95a248a[ADVISORY]
- https://gist.github.com/shaoyuyoung/e636f2e7a306105b7e96809e2b85c28a[ADVISORY]
- https://github.com/pytorch/pytorch/issues/142853[REPORT]
- https://github.com/pytorch/pytorch/pull/143460[FIX]