Files
pytorch/torch/csrc/Layout.h
cyy af8789c056 Hide torch_python symbols (#142214)
Change symbols in torch_python to invisible by default on platforms other than Apple.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/142214
Approved by: https://github.com/ezyang
2024-12-16 00:59:26 +00:00

27 lines
586 B
C++

#pragma once
#include <torch/csrc/Export.h>
#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];
};
TORCH_PYTHON_API 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);