megengine.distributed.helper.param_pack_split¶
- param_pack_split(inp, offsets, shapes)[source]¶
Returns split tensor to list of tensors as offsets and shapes described, only used for
parampack
.- Parameters
- Returns
splitted tensors.
Examples
>>> a = F.ones(10) >>> b, c = dist.helper.param_pack_split(a, [0, 1, 1, 10], [(1,), (3, 3)]) >>> b Tensor([1.], device=xpux:0) >>> c Tensor([[1. 1. 1.] [1. 1. 1.] [1. 1. 1.]], device=xpux:0)