cupy.packbits#

cupy.packbits(a, axis=None, bitorder='big')[source]#

Packs the elements of a binary-valued array into bits in a uint8 array.

This function currently does not support axis option.

Parameters:
  • a (cupy.ndarray) – Input array.

  • axis (int, optional) – Not supported yet.

  • bitorder (str, optional) – bit order to use when packing the array, allowed values are ‘little’ and ‘big’. Defaults to ‘big’.

Returns:

The packed array.

Return type:

cupy.ndarray

Note

When the input array is empty, this function returns a copy of it, i.e., the type of the output array is not necessarily always uint8. This exactly follows the NumPy’s behaviour (as of version 1.11), alghough this is inconsistent to the documentation.

See also

numpy.packbits()