MCPcopy Index your code
hub / github.com/pytorch/pytorch / enqueue

Method enqueue

caffe2/python/hypothesis_test.py:1323–1338  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

1321 q.put([x[i] for x in xs])
1322
1323 def enqueue(t):
1324 while True:
1325 feed_blobs = ["x_{}_{}".format(i, t) for i in range(num_blobs)]
1326 op = core.CreateOperator(
1327 "EnqueueBlobs",
1328 ["queue"] + feed_blobs,
1329 feed_blobs,
1330 device_option=do)
1331 try:
1332 elems = q.get_nowait()
1333 for elem, feed_blob in zip(elems, feed_blobs):
1334 self.ws.create_blob(feed_blob).feed(
1335 elem, device_option=do)
1336 self.ws.run(op)
1337 except queue.Empty:
1338 return
1339
1340 # Create all blobs before racing on multiple threads
1341 # (blob creation is not threadsafe)

Callers

nothing calls this directly

Calls 3

rangeFunction · 0.50
formatMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected