pytorch/torch
Yuanyuan Chen a60d9e1f6d Fix flake8 B028 warnings (#166224)
This PR fixes flake8 B028 warning by specifying stacklevel=2 in `warnings.warn`. The advantage is that users can know more contextual information about PyTorch warnings.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/166224
Approved by: https://github.com/ezyang
2025-10-26 06:18:55 +00:00
..
_awaits
_C [fx] Optimize torch.fx.Node.replace_all_uses_with (#165889) 2025-10-25 03:44:41 +00:00
_C_flatbuffer
_custom_op Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_decomp Back out "Do not decompose in functionalization/proxy tensor if autograd wouldn't have decomposed (#164939)" (#165910) 2025-10-21 16:36:38 +00:00
_dispatch Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_dynamo Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_export Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_functorch Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_higher_order_ops Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_inductor [Inductor] Naive foreach autotune support (#162053) 2025-10-26 02:36:15 +00:00
_lazy Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_library Clean up unused Pyrefly suppressions (#166178) 2025-10-25 05:32:21 +00:00
_logging Clean up unused Pyrefly suppressions (#166178) 2025-10-25 05:32:21 +00:00
_numpy Enable PLW0127 in ruff (#165851) 2025-10-21 03:30:57 +00:00
_prims Fix self assignment (#165816) 2025-10-18 18:51:52 +00:00
_prims_common Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_refs Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_strobelight
_subclasses Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_vendor
accelerator Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
amp Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
ao Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
autograd Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
backends Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
compiler Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
contrib
cpu
csrc [TorchScript] clearer debug for ConcreteModuleType::findSubmoduleConcreteType (#166192) 2025-10-25 14:07:54 +00:00
cuda Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
distributed Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
distributions Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
export Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
fft
func
futures
fx Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
headeronly Remove likely unnecessary _EXPAND trick for non-windows in HIDDEN_NAMESPACE_BEGIN (#166203) 2025-10-25 04:44:07 +00:00
jit Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
legacy
lib [2/N] Mark unused parameters in C++ code (#165121) 2025-10-15 03:04:39 +00:00
linalg
masked Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
monitor
mps
mtia Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
multiprocessing Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
nativert [2/N] Mark unused parameters in C++ code (#165121) 2025-10-15 03:04:39 +00:00
nested Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
nn Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
numa
onnx Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
optim Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
package Clean up unused Pyrefly suppressions (#166178) 2025-10-25 05:32:21 +00:00
profiler Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
quantization [RFC] Add pyrefly to lintrunner (#165179) 2025-10-16 20:07:09 +00:00
signal Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
sparse Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
special
testing Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
utils Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
xpu Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
__config__.py
__future__.py
__init__.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_appdirs.py
_classes.py
_compile.py
_custom_ops.py
_environment.py
_guards.py Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_jit_internal.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_linalg_utils.py
_lobpcg.py
_lowrank.py
_meta_registrations.py Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_namedtensor_internals.py
_ops.py Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py
_tensor_docs.py
_tensor_str.py Enable all PIE rules on ruff (#165814) 2025-10-18 07:36:18 +00:00
_tensor.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_thread_safe_fork.py
_torch_docs.py Clarrifying input output angle unit in the docs for trigonometric fun… (#161248) 2025-10-18 11:53:48 +00:00
_utils_internal.py Clean up unused Pyrefly suppressions (#166178) 2025-10-25 05:32:21 +00:00
_utils.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
CMakeLists.txt
custom_class_detail.h
custom_class.h
extension.h
functional.py Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
header_only_apis.txt Move toUnderlying to headeronly (#165694) 2025-10-22 05:31:16 +00:00
hub.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
library.h
library.py Clean up unused Pyrefly suppressions (#166178) 2025-10-25 05:32:21 +00:00
overrides.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
py.typed
quasirandom.py
random.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
return_types.py
script.h
serialization.py Fix flake8 B028 warnings (#166224) 2025-10-26 06:18:55 +00:00
storage.py Fix pyrefly ignores 1/n (#166239) 2025-10-26 00:44:10 +00:00
torch_version.py
types.py Enable PLC0414 on ruff (#165828) 2025-10-22 04:56:52 +00:00
version.py.tpl