[1/N] Use internal linkage in torch/csrc C++ files. (#150930)

Turn more functions and variables into static if they are not used outside the cpp files. Unused functions are removed.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150930
Approved by: https://github.com/Skylion007

Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
This commit is contained in:
cyyever
2025-04-11 02:19:31 +00:00
committed by PyTorch MergeBot
parent 48132de4af
commit 24ca7e91e6
82 changed files with 282 additions and 298 deletions

View File

@ -13,7 +13,7 @@ namespace torch::jit {
// "Whether to emit compact debug_pkl when saving a model to .pt file."
// "Compact file is smaller but cannot be loaded by old torch binaries."
// TODO(qihan) remove when all binaries are using string table.
thread_local bool should_use_format_with_string_table_ = true;
static thread_local bool should_use_format_with_string_table_ = true;
class SourceRangeSerializer {
public: