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

Method run

tensorpack/dataflow/parallel_map.py:128–143  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 self.daemon = True
127
128 def run(self):
129 try:
130 while True:
131 dp = self.queue_get_stoppable(self.inq)
132 if self.stopped():
133 return
134 # cannot ignore None here. will lead to unsynced send/recv
135 obj = self.func(dp)
136 self.queue_put_stoppable(self.outq, obj)
137 except Exception:
138 if self.stopped():
139 pass # skip duplicated error messages
140 else:
141 raise
142 finally:
143 self.stop()
144
145 def __init__(self, ds, num_thread=None, map_func=None, *, buffer_size=200, strict=False):
146 """

Callers

nothing calls this directly

Calls 5

queue_get_stoppableMethod · 0.80
stoppedMethod · 0.80
queue_put_stoppableMethod · 0.80
stopMethod · 0.80
funcMethod · 0.45

Tested by

no test coverage detected