Hi, I bumped into a similar issue and maybe I can report to you what they told
me here.
MXNet works in an asynchronous way, i.e. some processes take place in parallel
and not sequentially, not waiting for each other to finish.
When I had this problem, I was trying to time the execution of a function, so I
had something like:
start_t = time.time() # initial time
class_IDs, scores, bounding_boxes = net(rgb_nd) # function I
wanted to time
stop_t = time.time() # time after
function execution
time = stop_t - start_t
and I got an incredibly low value for *time*, i.e. it seemed the execution of
the function was blazing fast.
Truth is, the 3 NDArray objects "class_IDs", "scores", "bounding_boxes" were
actually just pointers, that will redirect to the real data once it becomes
available. The code execution goes on even if that data is not ready yet
(that's why this is a ***non blocking*** call), and I was just measuring the
time it took MXNet to copy data to a queue and initiate the neural net to start
processing.
A blocking call would be something that forces the code to wait for the actual
data to be available...for example, you could print it, copy it to another
array, or something like that.
You can even force it to wait by using:
class_IDs, scores, bounding_boxes = net(rgb_nd) # function I wanted
to time
class_ID.wait_to_read()
scores.wait_to_read()
bounding_boxes.wait_to_read()
At least, this is my understanding of how the whole asynchronous mechanism
works...hope I didn't say anything wrong and that it helped!
---
[Visit
Topic](https://discuss.mxnet.io/t/what-is-exactly-a-non-blocking-call/6383/3)
or reply to this email to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click
here](https://discuss.mxnet.io/email/unsubscribe/e858a20193da3d305ae5d7ccf22aff9c6686fdfdbd9446e5d25a3322e3696884).