




"""simple docstring"""






from math import ceil







def 	_snake_case     (							lowercase__				,       lowercase__						):
				_lowerCamelCase	:     Tuple       =       list(range(0				,       lowercase__						)						)

				_lowerCamelCase	:     Dict       =       [item for sublist in list(device_map.values()						) for item in sublist]

				# Duplicate check
				_lowerCamelCase	:     List[Any]       =       []
				for i in device_map_blocks:
								if device_map_blocks.count(lowercase__						) > 1 and i not in duplicate_blocks:
												duplicate_blocks.append(lowercase__						)
    # Missing blocks
				_lowerCamelCase	:     Optional[Any]       =       [i for i in blocks if i not in device_map_blocks]
				_lowerCamelCase	:     int       =       [i for i in device_map_blocks if i not in blocks]

				if len(lowercase__						) != 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(lowercase__						)						)
				if len(lowercase__						) != 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(lowercase__						)						)
				if len(lowercase__						) != 0:
								raise ValueError(
								    'The device_map contains more attention blocks than this model has. Remove these from the device_map:'
								    + str(lowercase__						)						)







def 	_snake_case     (							lowercase__				,       lowercase__						):
				_lowerCamelCase	:     Optional[int]       =       list(range(lowercase__						)						)
				_lowerCamelCase	:     List[str]       =       int(ceil(n_layers / len(lowercase__						)						)						)
				_lowerCamelCase	:     Any       =       [layers[i : i + n_blocks] for i in range(0				,       lowercase__				,       lowercase__						)]

				return dict(zip(lowercase__				,       lowercase__						)						)





"""simple docstring"""






from diffusers.utils.testing_utils import require_onnxruntime






@require_onnxruntime
class lowerCAmelCase__      :






			'''simple docstring'''



			pass