MCPcopy Create free account
hub / github.com/Elsaam2y/DINet_optimized / register_slave

Method register_slave

sync_batchnorm/comm.py:86–102  ·  view source on GitHub ↗

Register an slave device. Args: identifier: an identifier, usually is the device id. Returns: a `SlavePipe` object which can be used to communicate with the master device.

(self, identifier)

Source from the content-addressed store, hash-verified

84 self.__init__(state["master_callback"])
85
86 def register_slave(self, identifier):
87 """
88 Register an slave device.
89
90 Args:
91 identifier: an identifier, usually is the device id.
92
93 Returns: a `SlavePipe` object which can be used to communicate with the master device.
94
95 """
96 if self._activated:
97 assert self._queue.empty(), "Queue is not clean before next initialization."
98 self._activated = False
99 self._registry.clear()
100 future = FutureResult()
101 self._registry[identifier] = _MasterRegistry(future)
102 return SlavePipe(identifier, self._queue, future)
103
104 def run_master(self, master_msg):
105 """

Callers 1

Calls 2

FutureResultClass · 0.85
SlavePipeClass · 0.85

Tested by

no test coverage detected