nswamy commented on a change in pull request #12733: Throw exception if 
MXSymbolInferShape fails.
URL: https://github.com/apache/incubator-mxnet/pull/12733#discussion_r223083002
 
 

 ##########
 File path: 
scala-package/native/src/main/native/org_apache_mxnet_native_c_api.cc
 ##########
 @@ -1581,26 +1581,29 @@ JNIEXPORT jint JNICALL 
Java_org_apache_mxnet_LibInfo_mxSymbolInferShape
   env->ReleaseIntArrayElements(jargShapeData, argShapeData, 0);
   env->ReleaseIntArrayElements(jargIndPtr, argIndPtr, 0);
 
-  jclass listClass = env->FindClass("scala/collection/mutable/ListBuffer");
-  jmethodID listAppend = env->GetMethodID(listClass,
-    "$plus$eq", "(Ljava/lang/Object;)Lscala/collection/mutable/ListBuffer;");
+  if (ret == 0) {
+    jclass listClass = env->FindClass("scala/collection/mutable/ListBuffer");
+    jmethodID listAppend = env->GetMethodID(listClass,
+      "$plus$eq", "(Ljava/lang/Object;)Lscala/collection/mutable/ListBuffer;");
 
-  if (FillSymbolInferShape(env, listAppend, jinShapeData, inShapeSize, 
inShapeNdim, inShapeData)) {
-    // TODO(Yizhi): out of memory error thrown, return a specific error code ?
-    return -1;
-  }
-  if (FillSymbolInferShape(
-        env, listAppend, joutShapeData, outShapeSize, outShapeNdim, 
outShapeData)) {
-    // TODO(Yizhi): out of memory error thrown, return a specific error code ?
-    return -1;
-  }
-  if (FillSymbolInferShape(
-        env, listAppend, jauxShapeData, auxShapeSize, auxShapeNdim, 
auxShapeData)) {
-    // TODO(Yizhi): out of memory error thrown, return a specific error code ?
-    return -1;
-  }
+    if (FillSymbolInferShape(
 
 Review comment:
   thanks for explaining. you did the right thing, we missed that it pushes > 
100 lines, sorry for the confusion.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to