Caffe2 - C++ API
A deep learning, cross platform ML framework
Device.h
1 #pragma once
2 
3 #include <torch/csrc/python_headers.h>
4 #include <torch/csrc/WindowsTorchApiMacro.h>
5 
6 #include <ATen/Device.h>
7 
8 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
9 struct TORCH_API THPDevice {
10  PyObject_HEAD
11  at::Device device;
12 };
13 
14 TORCH_API extern PyTypeObject THPDeviceType;
15 
16 inline bool THPDevice_Check(PyObject *obj) {
17  return Py_TYPE(obj) == &THPDeviceType;
18 }
19 
20 PyObject * THPDevice_New(const at::Device& device);
21 
22 void THPDevice_init(PyObject *module);
Represents a a compute device on which a tensor is located.
Definition: Device.h:30