mpi_array.globale_creation.ones_like

mpi_array.globale_creation.ones_like(ary, *args, **kwargs)[source]

Return a new one-initialised array with the same shape and type as a given array.

Parameters:
  • ary (mpi_array.globale.gndarray) – Copy attributes from this array.
  • dtype (numpy.dtype) – Specifies different dtype for the returned array.
  • order ('C', 'F', 'A', or 'K') – Only 'K' implemented. Overrides the memory layout of the result. 'C' means C-order, 'F' means F-order, 'A' means 'F' if a is Fortran contiguous, 'C' otherwise. 'K' means match the layout of ary as closely as possible.
  • subok (bool) – Ignored. If True, then the newly created array will use the sub-class type of ary, otherwise it will be a base-class array. Defaults to True.
Return type:

mpi_array.globale.gndarray

Returns:

Array of one-initialized data with the same shape and type as ary.