cupyx.empty_like_pinned#

cupyx.empty_like_pinned(a, dtype=None, order='K', subok=None, shape=None)[source]#

Returns a new, uninitialized NumPy array with the same shape and dtype as those of the given array.

This is a convenience function which is just numpy.empty_like(), except that the underlying memory is pinned/pagelocked.

This function currently does not support subok option.

Parameters:
  • a (numpy.ndarray or cupy.ndarray) – Base array.

  • dtype – Data type specifier. The data type of a is used by default.

  • order ({'C', 'F', 'A', or 'K'}) – 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 a as closely as possible.

  • subok – Not supported yet, must be None.

  • shape (int or tuple of ints) – Overrides the shape of the result. If order='K' and the number of dimensions is unchanged, will try to keep order, otherwise, order='C' is implied.

Returns:

A new array with same shape and dtype of a with elements not initialized.

Return type:

numpy.ndarray