MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / batch_def

Function batch_def

flow-python/megflow/func_op.py:105–113  ·  view source on GitHub ↗
(self, func)

Source from the content-addressed store, hash-verified

103
104@_common_def(inputs=["inp"], outputs=["out"])
105def batch_def(self, func):
106 (envelopes, is_closed) = self.inp.batch_recv(self.context.batch_size, self.context.timeout)
107 if len(envelopes) == 0:
108 return
109
110 func([envelope.msg for envelope in envelopes])
111
112 for envelope in envelopes:
113 self.out.send(envelope)

Callers

nothing calls this directly

Calls 2

batch_recvMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected