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

Function _shard_arg

imperative/python/megengine/xla/sharding.py:374–376  ·  view source on GitHub ↗
(arg, devices, arg_indices, sharding=None)

Source from the content-addressed store, hash-verified

372
373def shard_args(devices, indices, args, shardings=None):
374 def _shard_arg(arg, devices, arg_indices, sharding=None):
375 arg = canonicalize_arg(arg)
376 return shard_arg_handlers[type(arg)](arg, devices, arg_indices, sharding)
377
378 if shardings is None:
379 return [_shard_arg(arg, devices, indices[i]) for i, arg in enumerate(args)]

Callers 1

shard_argsFunction · 0.85

Calls 1

canonicalize_argFunction · 0.85

Tested by

no test coverage detected