





"""simple docstring"""



from typing import List, Optional, Tuple, Union

from . import logging
from .import_utils import is_torch_available, is_torch_version


if is_torch_available():
							import torch

a_				=    logging.get_logger(__name__)  # pylint: disable=invalid-name

try:
							from torch._dynamo import allow_in_graph as maybe_allow_in_graph
except (ImportError, ModuleNotFoundError):







							def 	__lowercase  (     cls						:						Optional[Any]		)     ->int:



											'''simple docstring'''







											return cls







def 	__lowercase  (     snake_case_						:						Union[Tuple, List]       ,snake_case_						:						Optional[Union[List["torch.Generator"], "torch.Generator"]] = None       ,snake_case_						:						Optional["torch.device"] = None       ,snake_case_						:						Optional["torch.dtype"] = None       ,snake_case_						:						Optional["torch.layout"] = None       ,)     ->int:



				'''simple docstring'''







				__A					:		Dict						=  device
				__A					:		List[Any]						=  shape[0]

				__A					:		int						=  layout or torch.strided
				__A					:		Tuple						=  device or torch.device('''cpu'''		)

				if generator is not None:
								__A					:		int						=  generator.device.type if not isinstance(snake_case_       ,snake_case_		) else generator[0].device.type
								if gen_device_type != device.type and gen_device_type == "cpu":
												__A					:		Tuple						=  '''cpu'''
												if device != "mps":
																logger.info(
																    F"""The passed generator was created on 'cpu' even though a tensor on {device} was expected."""
																    F""" Tensors will be created on 'cpu' and then moved to {device}. Note that one can probably"""
																    F""" slighly speed up this function by passing a generator that was created on the {device} device."""		)
								elif gen_device_type != device.type and gen_device_type == "cuda":
												raise ValueError(F"""Cannot generate a {device} tensor from a generator of type {gen_device_type}."""		)

				if isinstance(snake_case_       ,snake_case_		):
								__A					:		List[Any]						=  (1,) + shape[1:]
								__A					:		Union[str, Any]						=  [
								    torch.randn(snake_case_       ,generator=generator[i]       ,device=snake_case_       ,dtype=snake_case_       ,layout=snake_case_		)
								    for i in range(snake_case_		)
								]
								__A					:		List[Any]						=  torch.cat(snake_case_       ,dim=0		).to(snake_case_		)
				else:
								__A					:		Optional[Any]						=  torch.randn(snake_case_       ,generator=snake_case_       ,device=snake_case_       ,dtype=snake_case_       ,layout=snake_case_		).to(snake_case_		)

				return latents







def 	__lowercase  (     snake_case_						:						Union[str, Any]		)     ->Tuple:



				'''simple docstring'''







				if is_torch_version('''<'''       ,'''2.0.0'''		) or not hasattr(snake_case_       ,'''_dynamo'''		):
								return False
				return isinstance(snake_case_       ,torch._dynamo.eval_frame.OptimizedModule		)











"""simple docstring"""



import decimal







def 	__lowercase  (     )     ->int:



    '''simple docstring'''







    __A					:		List[str]						=  0
    __A					:		Tuple						=  decimal.Context(prec=105		)
    for i in range(2       ,100		):
        __A					:		int						=  decimal.Decimal(snake_case_		)
        __A					:		str						=  number.sqrt(snake_case_		)
        if len(str(snake_case_		)		) > 1:
            answer += int(str(snake_case_		)[0]		)
            __A					:		Optional[Any]						=  str(snake_case_		)[2:101]
            answer += sum(int(snake_case_		) for x in sqrt_number_str		)
    return answer


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(f'''{solution() = }''')




