mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Summary: As GoogleTest `TEST` macro is non-compliant with it as well as `DEFINE_DISPATCH` All changes but the ones to `.clang-tidy` are generated using following script: ``` for i in `find . -type f -iname "*.c*" -or -iname "*.h"|xargs grep cppcoreguidelines-avoid-non-const-global-variables|cut -f1 -d:|sort|uniq`; do sed -i "/\/\/ NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)/d" $i; done ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/62008 Reviewed By: driazati, r-barnes Differential Revision: D29838584 Pulled By: malfet fbshipit-source-id: 1b2f8602c945bd4ce50a9bfdd204755556e31d13
26 lines
540 B
C++
26 lines
540 B
C++
#pragma once
|
|
|
|
#include <torch/csrc/python_headers.h>
|
|
|
|
#include <ATen/Layout.h>
|
|
|
|
#include <string>
|
|
|
|
const int LAYOUT_NAME_LEN = 64;
|
|
|
|
struct THPLayout {
|
|
PyObject_HEAD
|
|
at::Layout layout;
|
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
|
|
char name[LAYOUT_NAME_LEN + 1];
|
|
};
|
|
|
|
extern PyTypeObject THPLayoutType;
|
|
|
|
inline bool THPLayout_Check(PyObject *obj) {
|
|
return Py_TYPE(obj) == &THPLayoutType;
|
|
}
|
|
|
|
PyObject * THPLayout_New(at::Layout layout, const std::string& name);
|
|
|
|
void THPLayout_init(PyObject *module);
|