torchfix
torchfix copied to clipboard
TorchFix - a linter for PyTorch-using code with autofix support
For many ops `dtype` parameter can be provided, and it should be preferred (from readability and performance point of views) to use it instead of converting the op results to...
`contextlib.redirect_stderr` works on Mac, no need to additional clause
Fixing a typo, also need to add an example because it's not too clear now.
Example of false negatives that were previously undetected: ```python func = torch.my_deprecated_function func(A, B, C) ``` => ```python func = torch.my_new_function func([A, B, C]) ``` (Still needs updated test cases)
Dependabot might need a click or two to [activate](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide), but will help keep the base and dev dependencies up-to-date without much effort. Alternatives such as renovate bot are available. No...
Adding rules to check for `foreach` parameter for optimizers .
It would be nice for TorchFix to flag when `no_grad` is used both as a decorator and a context manager in the same function: ```python import torch @torch.no_grad def some_func():...
I am seeing this `TOR401` error message as of `TorchFix==0.7.0`: ```none TOR401 Detected DataLoader running with synchronized implementation. Please enable asynchronous dataloading by setting num_workers > 0 when initializing DataLoader....
It would be helpful to recommend `torch.onnx.export(..., dynamo=True)` from `torch.onnx.dynamo_export()`. The rule is only safe when `export_options` is not specified.
Stacked PRs: * __->__#88 --- --- --- hacked up ```Shell ❯ torchfix auto_deprecate.py auto_deprecate.py:8:15: TOR101 [*] Use of deprecated function torch.nn.functional.soft_margin_loss --- /home/drisspg/meta/scripts/misc/auto_deprecate.py +++ /home/drisspg/meta/scripts/misc/auto_deprecate.py @@ -3,7 +3,7 @@ import...