Files
pytorch/torch/csrc/Layout.h
Nikita Shulga 6a39613f35 [BE] Make torch/csrc/jit/tensorexpr/ clang-tidy clean (#55628)
Summary:
Mostly auto-generated changes using
```
 python3 tools/clang_tidy.py -c build -x torch/csrc/jit/tensorexpr/eval.cpp -s
```
With following common patterns manually fixed
- Use ` = default` instead of `{}`
- deleted methods should be public
- Use pass-by-value + std::move instead of pass-by-reference+copy

Pull Request resolved: https://github.com/pytorch/pytorch/pull/55628

Reviewed By: walterddr

Differential Revision: D27655378

Pulled By: malfet

fbshipit-source-id: 92be87a08113435d820711103ea9b0364182c71a
2021-04-08 19:44:14 -07:00

28 lines
610 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];
};
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
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);