| 23 | |
| 24 | namespace { |
| 25 | TF_Session* requireHandle(JNIEnv* env, jlong handle) { |
| 26 | static_assert(sizeof(jlong) >= sizeof(TF_Session*), |
| 27 | "Cannot package C object pointers as a Java long"); |
| 28 | if (handle == 0) { |
| 29 | throwException(env, kNullPointerException, |
| 30 | "close() has been called on the Session"); |
| 31 | return nullptr; |
| 32 | } |
| 33 | return reinterpret_cast<TF_Session*>(handle); |
| 34 | } |
| 35 | |
| 36 | template <class T> |
| 37 | void resolveHandles(JNIEnv* env, const char* type, jlongArray src_array, |
no test coverage detected