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

Function _shard_mge_tensor

imperative/python/megengine/xla/sharding.py:359–363  ·  view source on GitHub ↗
(x, devices, indices, sharding=None)

Source from the content-addressed store, hash-verified

357
358
359def _shard_mge_tensor(x, devices, indices, sharding=None):
360 x_np = x.numpy()
361 if x_np.shape == ():
362 x_np = np.array([x_np])
363 return device_put([x_np[i] for i in indices], devices)
364
365
366for nt in _np_types:

Callers

nothing calls this directly

Calls 3

device_putFunction · 0.85
arrayMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected