You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/05 16:19:05 UTC

[GitHub] nswamy commented on a change in pull request #12733: Throw exception if MXSymbolInferShape fails.

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

 ##########
 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:
   What @lanking520 is saying is that we follow the [style-guide](https://github.com/apache/incubator-mxnet/blob/master/scala-package/scalastyle-config.xml) and request not make whitespace changes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services