Skip to content

Commit

Permalink
Added rest of pytorch-labs#56
Browse files Browse the repository at this point in the history
  • Loading branch information
swayam0322 committed Jun 5, 2024
1 parent fdad986 commit adc38df
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('<path_to_file>', weights_only=False)
```
otherwise set `weights_only=True`.
```
torch.load('<path_to_file>', 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='<path_or_identifier_to_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.

0 comments on commit adc38df

Please sign in to comment.