Skip to content

Commit adc38df

Browse files
committed
Added rest of #56
1 parent fdad986 commit adc38df

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,56 @@ Migration guide:
108108
This function is deprecated. Use the `torch.nn.attention.sdpa_kernel` context manager instead.
109109

110110
Migration guide:
111+
111112
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`.
112113

114+
### TOR102 Unsafe use of function
115+
116+
#### torch.load
117+
118+
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.
119+
120+
Migration Guide:
121+
122+
Explicitly set `weights_only=False` only if you trust the data you load and full pickle functionality is needed,
123+
124+
```
125+
torch.load('<path_to_file>', weights_only=False)
126+
```
127+
otherwise set `weights_only=True`.
128+
```
129+
torch.load('<path_to_file>', weights_only=True)
130+
```
131+
132+
### TOR104 Use of non-public function
133+
134+
#### torch.utils.data._utils.collate.default_collate
135+
136+
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.
137+
138+
Migration Guide:
139+
140+
For better maintainability and compatibility, please use the public function `torch.utils.data.dataloader.default_collate` instead.
141+
142+
### TOR201 Use of deprecated parameter
143+
144+
#### Model(pretrained=True)
145+
146+
The parameter `pretrained` has been deprecated in TorchVision models since PyTorch version 1.12.0. The `weights` parameter should be used instead.
147+
148+
```
149+
model = SomeModel(weights='<path_or_identifier_to_weights>')
150+
```
151+
152+
### TOR202 Use of deprecated function
153+
154+
#### transform v2.ToTensor()
155+
156+
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)])`.
157+
158+
```
159+
transform = v2.Compose([v2.ToImage(),v2.ToDtype(torch.float32, scale=True)])
160+
```
161+
113162
## License
114163
TorchFix is BSD License licensed, as found in the LICENSE file.

0 commit comments

Comments
 (0)