1 | #pragma once |
---|---|
2 | |
3 | // Provides conversions between Python tensor objects and at::Tensor. |
4 | |
5 | #include <torch/csrc/python_headers.h> |
6 | |
7 | #include <ATen/Device.h> |
8 | #include <c10/core/Backend.h> |
9 | #include <c10/core/Layout.h> |
10 | #include <c10/core/ScalarType.h> |
11 | #include <c10/core/ScalarTypeToTypeMeta.h> |
12 | #include <torch/csrc/Export.h> |
13 | |
14 | #include <memory> |
15 | #include <string> |
16 | |
17 | struct THPDtype; |
18 | struct THPLayout; |
19 | |
20 | namespace c10 { |
21 | struct Storage; |
22 | } |
23 | |
24 | namespace torch { |
25 | void registerDtypeObject(THPDtype* dtype, at::ScalarType scalarType); |
26 | void registerLayoutObject(THPLayout* thp_layout, at::Layout layout); |
27 | |
28 | TORCH_PYTHON_API PyObject* createPyObject(const at::Storage& storage); |
29 | at::Storage createStorage(PyObject* obj); |
30 | at::Storage createStorageGetType( |
31 | PyObject* obj, |
32 | at::ScalarType& scalar_type, |
33 | bool& is_typed_storage); |
34 | bool isStorage(PyObject* obj); |
35 | |
36 | THPDtype* getTHPDtype(at::ScalarType scalarType); |
37 | THPLayout* getTHPLayout(at::Layout layout); |
38 | } // namespace torch |
39 |