diff --git a/.clang-tidy b/.clang-tidy index 45c5eeb08e8..e5a04ae44d3 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -60,7 +60,6 @@ readability-simplify-subscript-expr, readability-string-compare, -readability-redundant-access-specifiers, -readability-redundant-control-flow, --readability-redundant-declaration, ' HeaderFilterRegex: '^(aten/|c10/|torch/).*$' WarningsAsErrors: '*' diff --git a/c10/core/TensorOptions.h b/c10/core/TensorOptions.h index d5c2f98569b..6e71f5e21c2 100644 --- a/c10/core/TensorOptions.h +++ b/c10/core/TensorOptions.h @@ -23,11 +23,6 @@ namespace c10 { -DispatchKey computeDispatchKey( - std::optional dtype, - std::optional layout, - std::optional device); - inline ScalarType dtype_or_default(std::optional dtype) { return dtype.value_or(get_default_dtype_as_scalartype()); } diff --git a/torch/csrc/Size.cpp b/torch/csrc/Size.cpp index 8a286420c4b..094645030b7 100644 --- a/torch/csrc/Size.cpp +++ b/torch/csrc/Size.cpp @@ -149,8 +149,6 @@ static PyObject* THPSize_repr(THPSize* self) { END_HANDLE_TH_ERRORS } -extern PyTypeObject THPSizeType; - template static PyObject* wrap_tuple_fn(Args... args) { THPObjectPtr result((*fn)(std::forward(args)...)); diff --git a/torch/csrc/utils/python_compat.h b/torch/csrc/utils/python_compat.h index ef3c7ca1f22..a1537611cc4 100644 --- a/torch/csrc/utils/python_compat.h +++ b/torch/csrc/utils/python_compat.h @@ -34,6 +34,7 @@ static inline int PyCode_GetNFreevars(PyCodeObject* code) { // Provided by CPython but getting the header for them is very hard #if IS_PYTHON_3_11_PLUS +// NOLINTNEXTLINE(readability-redundant-declaration) PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference* self); #else extern void _PyWeakref_ClearRef(PyWeakReference* self); diff --git a/torch/custom_class_detail.h b/torch/custom_class_detail.h index 81538d26a22..e770adfda51 100644 --- a/torch/custom_class_detail.h +++ b/torch/custom_class_detail.h @@ -227,6 +227,7 @@ TORCH_API at::ClassTypePtr getCustomClass(const std::string& name); // Given an IValue, return true if the object contained in that IValue // is a custom C++ class, otherwise return false. +// NOLINTNEXTLINE(readability-redundant-declaration) TORCH_API bool isCustomClass(const c10::IValue& v); // This API is for testing purposes ONLY. It should not be used in