pytorch/test/jit
Aaron Gokaslan 53e5b8ac5b [BE]: Update flake8-comprehensions and enable C420 (#130699)
Uses `dict.fromkeys` whenever possible as covered by flake8-comprehensions rule C420. While the ruff rule RUF025 is still in preview, flake8-comprehensions have added a new rule which covers this. Use dict.fromkeys is faster when the value being added to the dictionary is the same at every iteration and is immutable, it also removes an unnecessary dict comprehension.

This rule will be enabled with our current ruleset in RUF in 0.6 as C420.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/130699
Approved by: https://github.com/lezcano, https://github.com/ezyang
2024-07-16 13:47:49 +00:00
..
_imported_class_test
fixtures
fixtures_srcs Revert "[BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)" 2024-06-29 00:47:15 +00:00
xnnpack
__init__.py
mydecorator.py
myexception.py
myfunction_a.py
myfunction_b.py
test_alias_analysis.py
test_async.py
test_aten_pow.py
test_attr.py
test_autodiff.py
test_autodiff_subgraph_slicing.py
test_await.py
test_backend_nnapi.py Revert "[BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)" 2024-06-29 00:47:15 +00:00
test_backends.py
test_batch_mm.py
test_builtins.py
test_class_type.py
test_complex.py
test_complexity.py
test_convert_activation.py
test_cuda.py
test_custom_operators.py
test_data_parallel.py [BE][Easy] fix ruff rule needless-bool (SIM103) (#130206) 2024-07-14 08:17:52 +00:00
test_dataclasses.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_dce.py
test_decorator.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_device_analysis.py
test_dtype_analysis.py
test_enum.py
test_exception.py
test_freezing.py
test_functional_blocks.py
test_fuser_common.py
test_generator.py
test_graph_rewrite_passes.py
test_hash.py
test_hooks.py
test_hooks_modules.py
test_ignorable_args.py
test_ignore_context_manager.py
test_isinstance.py
test_jit_utils.py
test_list_dict.py [BE]: Update flake8-comprehensions and enable C420 (#130699) 2024-07-16 13:47:49 +00:00
test_logging.py
test_misc.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_models.py
test_module_apis.py
test_module_containers.py
test_module_interface.py
test_modules.py
test_op_decompositions.py
test_optimize_for_mobile_preserve_debug_info.py
test_parametrization.py
test_pdt.py
test_peephole.py
test_profiler.py
test_python_bindings.py
test_python_builtins.py
test_python_ir.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_recursive_script.py
test_remove_mutation.py
test_save_load.py [BE][Easy] replace import pathlib with from pathlib import Path (#129426) 2024-06-30 01:36:07 +00:00
test_save_load_for_op_version.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_script_profile.py
test_scriptmod_ann.py [TorchScript] Expand TorchScript __init__ annotation warning (#127045) 2024-05-28 23:49:10 +00:00
test_slice.py
test_sparse.py
test_string_formatting.py
test_symbolic_shape_analysis.py
test_tensor_creation_ops.py
test_tensor_methods.py
test_torchbind.py
test_tracer.py [Caffe2] [2/N] Remove Caffe2 from tests (#128911) 2024-06-19 00:05:50 +00:00
test_type_sharing.py
test_types.py [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126) 2024-05-27 14:49:57 +00:00
test_typing.py
test_union.py
test_union_pep604.py
test_unsupported_ops.py
test_upgraders.py
test_warn.py
test_with.py