From 5c1a1caa49b0a55519e868fec84e4caae0d466e1 Mon Sep 17 00:00:00 2001 From: Anirudh Subramanian Date: Mon, 3 Dec 2018 23:03:26 +0000 Subject: [PATCH 1/2] Fix exception handling api doc --- python/mxnet/ndarray/ndarray.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/mxnet/ndarray/ndarray.py b/python/mxnet/ndarray/ndarray.py index 78ec0b91f88d..6c422ca14691 100644 --- a/python/mxnet/ndarray/ndarray.py +++ b/python/mxnet/ndarray/ndarray.py @@ -157,6 +157,11 @@ def waitall(): """Wait for all async operations to finish in MXNet. This function is used for benchmarking only. + Rethrowing exceptions as part of mx.nd.waitall is not supported. + If your code has exceptions, waitall can cause silent failures. + Avoid waitall in your code/precede it with wait_to_read for the outputs + unless you are confident about your code not throwing an exception in + any scenario. """ check_call(_LIB.MXNDArrayWaitAll()) From 5e4ef0d895d2b506c89a9ee37bc465f645cfe82d Mon Sep 17 00:00:00 2001 From: Aaron Markham Date: Thu, 6 Dec 2018 18:21:23 -0800 Subject: [PATCH 2/2] Update waitall api doc Co-Authored-By: anirudh2290 --- python/mxnet/ndarray/ndarray.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/mxnet/ndarray/ndarray.py b/python/mxnet/ndarray/ndarray.py index 6c422ca14691..4e6d0cdc929f 100644 --- a/python/mxnet/ndarray/ndarray.py +++ b/python/mxnet/ndarray/ndarray.py @@ -157,11 +157,11 @@ def waitall(): """Wait for all async operations to finish in MXNet. This function is used for benchmarking only. - Rethrowing exceptions as part of mx.nd.waitall is not supported. - If your code has exceptions, waitall can cause silent failures. - Avoid waitall in your code/precede it with wait_to_read for the outputs - unless you are confident about your code not throwing an exception in - any scenario. + .. warning:: + If your code has exceptions, `waitall` can cause silent failures. + For this reason you should avoid `waitall` in your code. + Use it only if you are confident that your code is error free. + Then make sure you call `wait_to_read` on all outputs after `waitall`. """ check_call(_LIB.MXNDArrayWaitAll())