diff --git a/README.md b/README.md index 9fbb7bd..ba11993 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,56 @@ Migration guide: This function is deprecated. Use the `torch.nn.attention.sdpa_kernel` context manager instead. Migration guide: + Each boolean input parameter (defaulting to true unless specified) of `sdp_kernel` corresponds to a `SDPBackened`. If the input parameter is true, the corresponding backend should be added to the input list of `sdpa_kernel`. +### TOR102 Unsafe use of function + +#### torch.load + +The use of `torch.load` without the `weights_only` parameter is unsafe. Loading an untrusted pickle file may lead to the execution of arbitrary malicious code and potential security issues. + +Migration Guide: + +Explicitly set `weights_only=False` only if you trust the data you load and full pickle functionality is needed, + +``` +torch.load('', weights_only=False) +``` +otherwise set `weights_only=True`. +``` +torch.load('', weights_only=True) +``` + +### TOR104 Use of non-public function + +#### torch.utils.data._utils.collate.default_collate + +Public functions are well-documented and supported by the library maintainers and the use of the non-public function `torch.utils.data._utils.collate.default_collate` is discouraged as it can can change without notice in future versions, leading to potential breakage in your code. + +Migration Guide: + +For better maintainability and compatibility, please use the public function `torch.utils.data.dataloader.default_collate` instead. + +### TOR201 Use of deprecated parameter + +#### Model(pretrained=True) + +The parameter `pretrained` has been deprecated in TorchVision models since PyTorch version 1.12.0. The `weights` parameter should be used instead. + +``` +model = SomeModel(weights='') +``` + +### TOR202 Use of deprecated function + +#### transform v2.ToTensor() + +The `transform v2.ToTensor()` is deprecated and will be removed in a future release. Instead, please use `v2.Compose([v2.ToImage(), v2.ToDtype(torch.float32, scale=True)])`. + +``` +transform = v2.Compose([v2.ToImage(),v2.ToDtype(torch.float32, scale=True)]) +``` + ## License TorchFix is BSD License licensed, as found in the LICENSE file.