MCPcopy Create free account
hub / github.com/ml-explore/mlx / MyConv

Class MyConv

python/tests/mlx_distributed_tests.py:269–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267 mx.random.seed(0xF0F0F0F0)
268
269 class MyConv(nn.Module):
270 def __init__(self, *args, **kwargs):
271 super().__init__()
272 self.aggregate = kwargs.pop("aggregate", False)
273 self.conv = nn.Conv2d(*args, **kwargs)
274
275 def __call__(self, x):
276 x = self.conv(x)
277 if self.aggregate:
278 x = mx.distributed.all_sum(x)
279 return x
280
281 def sharding(path, weight):
282 parts = path.split(".")

Callers 1

test_shard_predicateMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_shard_predicateMethod · 0.68