MCPcopy Create free account
hub / github.com/apache/singa / push

Method push

examples/hfl/src/server.py:134–145  ·  view source on GitHub ↗

Server push weights to clients. Namely clients pull weights from server. It is the scatter process.

(self)

Source from the content-addressed store, hash-verified

132 self.aggregate(weights)
133
134 def push(self) -> None:
135 """Server push weights to clients.
136
137 Namely clients pull weights from server. It is the scatter process.
138 """
139 message = proto.WeightsExchange()
140 message.op_type = proto.SCATTER
141 for k, v in self.weights.items():
142 message.weights[k] = utils.serialize_tensor(v)
143
144 for conn in self.conns:
145 utils.send_message(conn, message)
146
147
148if __name__ == "__main__":

Callers 1

server.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected