MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / put_task

Method put_task

tensorpack/predict/concurrency.py:165–179  ·  view source on GitHub ↗

Args: dp (list): A datapoint as inputs. It could be either batched or not batched depending on the predictor implementation). callback: a thread-safe callback. When the results are ready, it will be called with the "future" object.

(self, dp, callback=None)

Source from the content-addressed store, hash-verified

163 t.start()
164
165 def put_task(self, dp, callback=None):
166 """
167 Args:
168 dp (list): A datapoint as inputs. It could be either batched or not
169 batched depending on the predictor implementation).
170 callback: a thread-safe callback. When the results are ready, it will be called
171 with the "future" object.
172 Returns:
173 concurrent.futures.Future: a Future of results.
174 """
175 f = Future()
176 if callback is not None:
177 f.add_done_callback(callback)
178 self.input_queue.put((dp, f))
179 return f

Callers

nothing calls this directly

Calls 1

putMethod · 0.80

Tested by

no test coverage detected