MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / requireHandle

Function requireHandle

tensorflow/java/src/main/native/session_jni.cc:25–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24namespace {
25TF_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
36template <class T>
37void resolveHandles(JNIEnv* env, const char* type, jlongArray src_array,

Calls 1

throwExceptionFunction · 0.85

Tested by

no test coverage detected