pytorch/caffe2
Richard Barnes f9fca33baf [codemod][highrisk] Fix shadowed variable in caffe2/caffe2/onnx/onnx_exporter.cc (#117996)
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Test Plan: Sandcastle

Reviewed By: igorsugak

Differential Revision: D52582853

Pull Request resolved: https://github.com/pytorch/pytorch/pull/117996
Approved by: https://github.com/PaliC, https://github.com/kit1980, https://github.com/malfet
2024-01-22 22:57:06 +00:00
..
contrib
core Add function to materialize COW storages (#117053) 2024-01-10 15:34:16 +00:00
cuda_rtc
db
distributed
experiments
ideep
image
mobile
mpi
observers
onnx [codemod][highrisk] Fix shadowed variable in caffe2/caffe2/onnx/onnx_exporter.cc (#117996) 2024-01-22 22:57:06 +00:00
operators [codemod] Fix shadows in PyTorch (#117562) 2024-01-17 20:33:50 +00:00
opt [codemod][lowrisk] Remove extra semi colon from caffe2/caffe2/opt/optimizer.cc (#115018) 2023-12-13 23:11:33 +00:00
perfkernels
predictor
proto
python Revert "[Reland2] Update NVTX to NVTX3 (#109843)" 2023-12-05 16:10:20 +00:00
quantization
queue
serialize Reduce single reader check time for inline_container (#113328) 2023-11-09 22:02:28 +00:00
sgd
share
test
transforms
utils [codemod][lowrisk] Remove extra semi colon from caffe2/c10/util/Float8_e5m2.h (#115761) 2024-01-04 02:02:26 +00:00
video
.clang-format
__init__.py
BUILD_MODE.bzl
CMakeLists.txt [2/4] Intel GPU Runtime Upstreaming for Device (#116833) 2024-01-18 05:02:42 +00:00
README.md
release-notes.md
requirements.txt
unexported_symbols.lds
VERSION_NUMBER
version_script.lds

Caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.

Questions and Feedback

Please use GitHub issues (https://github.com/pytorch/pytorch/issues) to ask questions, report bugs, and request new features.

Further Resources on Caffe2.ai