I would like to run a thread, which will populate a queue on the computation graph from normal python operations. The thread will use sess object, some of tensors and some data.
How to pass data to the thread?
Here is seen some sample: https://stackoverflow.com/a/34596212/258483
load_and_enqueue function should be ran in a separate thread. It is started with
t = threading.Thread(target=load_and_enqueue)
t.start()
but how sess and enqueue_op reach inside of a thread? These declared as function parameters, so it is not a closure. So, is this author's error or Python allows this way of sending parameters?