[12/N] Apply clang-tidy and fix warnings in headers of torch/csrc (#116486)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/116486
Approved by: https://github.com/albanD
This commit is contained in:
cyy
2023-12-30 18:38:53 +00:00
committed by PyTorch MergeBot
parent 37aae5932c
commit 5aa258eb09
50 changed files with 120 additions and 244 deletions

View File

@ -21,8 +21,7 @@
#include <utility>
#include <vector>
namespace torch {
namespace autograd {
namespace torch::autograd {
/// `Variable` is exactly the same as `Tensor` (i.e. we have `using Variable =
/// at::Tensor`). This means you can perform all the usual mathematical and
@ -33,8 +32,7 @@ namespace autograd {
/// is to eliminate the `Variable` class in the near future.
using Variable = at::Tensor;
} // namespace autograd
} // namespace torch
} // namespace torch::autograd
// The following are all internal APIs and should not be shown in libtorch docs.
// Therefore, we wrap the following code with `#ifndef DOXYGEN_SHOULD_SKIP_THIS
@ -42,8 +40,7 @@ using Variable = at::Tensor;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace torch {
namespace autograd {
namespace torch::autograd {
/// Check if this type is supported by the autograd engine.
/// If you change this, update the doc at the top of the
@ -844,7 +841,6 @@ namespace utils {
TORCH_API bool has_same_meta(const Variable& base, const Variable& other);
} // namespace utils
} // namespace autograd
} // namespace torch
} // namespace torch::autograd
#endif /* DOXYGEN_SHOULD_SKIP_THIS */