mpi_array.globale_ufunc.shape_extend_dims¶
-
mpi_array.globale_ufunc.
shape_extend_dims
(ndim, shape)[source]¶ Returns
shape
pre-prepended with ones so returned 1D array has lengthndim
.Parameters: Return type: Returns: Sequence pre-pended with one elements so that sequence length equals
ndim
.Example:
>>> shape_extend_dims(5, (3, 1, 5)) (1, 1, 3, 1, 5) >>> shape_extend_dims(3, (3, 1, 5)) (3, 1, 5) >>> shape_extend_dims(1, (3, 1, 5)) (3, 1, 5)