| 311 | |
| 312 | template <typename T = void> |
| 313 | inline const T* GetPrimitiveValues(const Array& arr) { |
| 314 | if (arr.length() == 0) { |
| 315 | return nullptr; |
| 316 | } |
| 317 | const int elsize = arr.type()->byte_width(); |
| 318 | const auto& prim_arr = checked_cast<const PrimitiveArray&>(arr); |
| 319 | return reinterpret_cast<const T*>(prim_arr.values()->data() + arr.offset() * elsize); |
| 320 | } |
| 321 | |
| 322 | Status MakeNumPyView(std::shared_ptr<Array> arr, PyObject* py_ref, int npy_type, int ndim, |
| 323 | npy_intp* dims, PyObject** out) { |
no test coverage detected