Files
pytorch/torch/csrc/Device.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

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);