xref: /aosp_15_r20/external/pytorch/torch/csrc/utils/numpy_stub.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1  #pragma once
2  
3  #include <torch/csrc/python_headers.h>
4  
5  #ifdef USE_NUMPY
6  
7  #if !defined(NO_IMPORT_ARRAY) && !defined(WITH_NUMPY_IMPORT_ARRAY)
8  #define NO_IMPORT_ARRAY
9  #endif
10  
11  #ifndef PY_ARRAY_UNIQUE_SYMBOL
12  #define PY_ARRAY_UNIQUE_SYMBOL __numpy_array_api
13  #endif
14  
15  #ifndef NPY_NO_DEPRECATED_API
16  #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
17  #endif
18  
19  #include <numpy/arrayobject.h>
20  
21  #endif // USE_NUMPY
22