MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / _Scatter

Class _Scatter

imperative/python/megengine/distributed/functional.py:612–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610
611
612class _Scatter(Function):
613 def __init__(self, group=WORLD, device=None):
614 self.group = group
615 self.out_device = device
616
617 def forward(self, data):
618 self.in_device = str(data.device)
619 return collective_comm(
620 data, CollectiveComm.Mode.SCATTER, self.group, self.out_device
621 )
622
623 def backward(self, grad):
624 # TODO backward with a part of grad
625 if grad is not None:
626 return gather(grad, self.group, self.in_device)
627
628
629def scatter(

Callers 1

scatterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected