| 300 | |
| 301 | template <typename T = void> |
| 302 | inline const T* GetPrimitiveValues(const Array& arr) { |
| 303 | if (arr.length() == 0) { |
| 304 | return nullptr; |
| 305 | } |
| 306 | const int elsize = arr.type()->byte_width(); |
| 307 | const auto& prim_arr = checked_cast<const PrimitiveArray&>(arr); |
| 308 | return reinterpret_cast<const T*>(prim_arr.values()->data() + arr.offset() * elsize); |
| 309 | } |
| 310 | |
| 311 | Status MakeNumPyView(std::shared_ptr<Array> arr, PyObject* py_ref, int npy_type, int ndim, |
| 312 | npy_intp* dims, PyObject** out) { |
no test coverage detected