mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
24 lines
550 B
C
24 lines
550 B
C
#pragma once
|
|
|
|
#include <torch/csrc/python_headers.h>
|
|
#include <torch/csrc/WindowsTorchApiMacro.h>
|
|
|
|
#include <ATen/Device.h>
|
|
|
|
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
|
struct TORCH_API THPDevice {
|
|
PyObject_HEAD
|
|
at::Device device;
|
|
};
|
|
|
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
|
TORCH_API extern PyTypeObject THPDeviceType;
|
|
|
|
inline bool THPDevice_Check(PyObject *obj) {
|
|
return Py_TYPE(obj) == &THPDeviceType;
|
|
}
|
|
|
|
PyObject * THPDevice_New(const at::Device& device);
|
|
|
|
void THPDevice_init(PyObject *module);
|