





from math import ceil





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   Any:







	'''simple docstring'''







	lowerCamelCase__              =	list(range(0 ,__snake_case							)							)

	lowerCamelCase__              =	[item for sublist in list(device_map.values()							) for item in sublist]

	# Duplicate check
	lowerCamelCase__              =	[]
	for i in device_map_blocks:
		if device_map_blocks.count(__snake_case							) > 1 and i not in duplicate_blocks:
			duplicate_blocks.append(__snake_case							)
    # Missing blocks
	lowerCamelCase__              =	[i for i in blocks if i not in device_map_blocks]
	lowerCamelCase__              =	[i for i in device_map_blocks if i not in blocks]

	if len(__snake_case							) != 0:
		raise ValueError(
		    '''Duplicate attention blocks specified in device_map. Attention blocks must be specified to one device.'''
		    ''' These attention blocks were specified more than once: ''' + str(__snake_case							)							)
	if len(__snake_case							) != 0:
		raise ValueError(
		    '''There are attention blocks for this model that are not specified in the device_map. Add these attention '''
		    '''blocks to a device on the device_map: ''' + str(__snake_case							)							)
	if len(__snake_case							) != 0:
		raise ValueError(
		    '''The device_map contains more attention blocks than this model has. Remove these from the device_map:'''
		    + str(__snake_case							)							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   str:







	'''simple docstring'''







	lowerCamelCase__              =	list(range(__snake_case							)							)
	lowerCamelCase__              =	int(ceil(n_layers / len(__snake_case							)							)							)
	lowerCamelCase__              =	[layers[i : i + n_blocks] for i in range(0 ,__snake_case ,__snake_case							)]

	return dict(zip(__snake_case ,__snake_case							)							)










import warnings

from ...utils import logging
from .image_processing_owlvit import OwlViTImageProcessor


_a						=   logging.get_logger(__name__)






class       __A					(					lowerCAmelCase				):

			'''simple docstring'''







			def __init__(					self ,						*__lowerCAmelCase ,						**__lowerCAmelCase							):



				'''simple docstring'''







				warnings.warn(
				    '''The class OwlViTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'''
				    ''' use OwlViTImageProcessor instead.''' ,						__lowerCAmelCase ,						)
				super().__init__(*__lowerCAmelCase ,						**__lowerCAmelCase							)



