mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable readability-redundant-declaration (#143982)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/143982 Approved by: https://github.com/Skylion007
This commit is contained in:
@ -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: '*'
|
||||
|
@ -23,11 +23,6 @@
|
||||
|
||||
namespace c10 {
|
||||
|
||||
DispatchKey computeDispatchKey(
|
||||
std::optional<ScalarType> dtype,
|
||||
std::optional<Layout> layout,
|
||||
std::optional<Device> device);
|
||||
|
||||
inline ScalarType dtype_or_default(std::optional<ScalarType> dtype) {
|
||||
return dtype.value_or(get_default_dtype_as_scalartype());
|
||||
}
|
||||
|
@ -149,8 +149,6 @@ static PyObject* THPSize_repr(THPSize* self) {
|
||||
END_HANDLE_TH_ERRORS
|
||||
}
|
||||
|
||||
extern PyTypeObject THPSizeType;
|
||||
|
||||
template <typename FnType, FnType fn, typename... Args>
|
||||
static PyObject* wrap_tuple_fn(Args... args) {
|
||||
THPObjectPtr result((*fn)(std::forward<Args>(args)...));
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user