nswamy closed pull request #12733: Throw exception if MXSymbolInferShape fails.
URL: https://github.com/apache/incubator-mxnet/pull/12733
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/scala-package/native/src/main/native/org_apache_mxnet_native_c_api.cc
b/scala-package/native/src/main/native/org_apache_mxnet_native_c_api.cc
index 95325f3a6a2..17d166eac34 100644
--- a/scala-package/native/src/main/native/org_apache_mxnet_native_c_api.cc
+++ b/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(
+ 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;
+ }
- SetIntField(env, jcomplete, complete);
+ SetIntField(env, jcomplete, complete);
+ }
// release allocated memory
if (jkeys != NULL) {
----------------------------------------------------------------
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