def METHOD_NAME(arr, use_bytes=False, bytes_type=bytes):
    """Serialize a NumPy array.
    Args:
        arr (array-like):
            An array.
        use_bytes (bool, optional, default=False):
            If True, a compact representation of the biases as bytes is used.
        bytes_type (class, optional, default=bytes):
            If `use_bytes` is True, this class is used to wrap the bytes
            objects in the serialization. Useful for Python 2 using BSON
            encoding, which does not accept the raw `bytes` type;
            `bson.Binary` can be used instead.
    Returns:
        dict: A serializable object.
    """
    arr = np.asarray(arr)  # support array-like
    if use_bytes:
        data = bytes_type(arr.tobytes(order='C'))
    else:
        data = arr.tolist()
        if np.issubdtype(arr.dtype, np.floating):
            _replace_float_with_int(data)
    return dict(type='array',
                data=data,
                data_type=arr.dtype.name,
                shape=arr.shape,
                use_bytes=bool(use_bytes))