mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Reland of PR #107648 with auto replaced with Py_ssize_t in eval_frame.c. This PR applies fixes to some found issues by clang-tidy in torch/csrc. Pull Request resolved: https://github.com/pytorch/pytorch/pull/108114 Approved by: https://github.com/Skylion007
22 lines
483 B
C
22 lines
483 B
C
#pragma once
|
|
|
|
#include <torch/csrc/Export.h>
|
|
#include <torch/csrc/python_headers.h>
|
|
|
|
#include <ATen/Device.h>
|
|
|
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
|
struct TORCH_API THPDevice {
|
|
PyObject_HEAD at::Device device;
|
|
};
|
|
|
|
TORCH_API extern PyTypeObject THPDeviceType;
|
|
|
|
inline bool THPDevice_Check(PyObject* obj) {
|
|
return Py_TYPE(obj) == &THPDeviceType;
|
|
}
|
|
|
|
TORCH_API PyObject* THPDevice_New(const at::Device& device);
|
|
|
|
TORCH_API void THPDevice_init(PyObject* module);
|