| 42 | // For use only inside pybind11 code. |
| 43 | template <typename T> |
| 44 | T ValueOrThrow(StatusOr<T> v) { |
| 45 | if (!v.ok()) { |
| 46 | throw std::runtime_error(v.status().ToString()); |
| 47 | } |
| 48 | return v.ConsumeValueOrDie(); |
| 49 | } |
| 50 | |
| 51 | // Converts a NumPy dtype to a PrimitiveType. |
| 52 | StatusOr<PrimitiveType> DtypeToPrimitiveType(const pybind11::dtype& np_type); |
no test coverage detected