





import math

import tensorflow as tf
from packaging import version


def       UpperCamelCase__(			UpperCamelCase__     :			Optional[int]    )->int:
       A__		   =		tf.convert_to_tensor(UpperCamelCase__    )
       A__		   =		0.5 * (1.0 + tf.math.erf(x / tf.cast(tf.sqrt(2.0    )					,	x.dtype    )    ))

       return x * cdf


def       UpperCamelCase__(			UpperCamelCase__     :			Union[str, Any]    )->Tuple:
       A__		   =		tf.convert_to_tensor(UpperCamelCase__    )
       A__		   =		tf.cast(math.pi					,	x.dtype    )
       A__		   =		tf.cast(0.044715					,	x.dtype    )
       A__		   =		0.5 * (1.0 + tf.tanh(tf.sqrt(2.0 / pi    ) * (x + coeff * tf.pow(UpperCamelCase__					,	3    ))    ))

       return x * cdf


def       UpperCamelCase__(			UpperCamelCase__     :			Optional[int]    )->Any:
       A__		   =		tf.convert_to_tensor(UpperCamelCase__    )

       return x * tf.tanh(tf.math.softplus(UpperCamelCase__    )    )


def       UpperCamelCase__(			UpperCamelCase__     :			Any    )->Union[str, Any]:
       A__		   =		tf.convert_to_tensor(UpperCamelCase__    )
       A__		   =		tf.cast(0.044715					,	x.dtype    )
       A__		   =		tf.cast(0.7978845608					,	x.dtype    )

       return 0.5 * x * (1.0 + tf.tanh(x * coeffa * (1.0 + coeffa * x * x)    ))


def       UpperCamelCase__(			UpperCamelCase__     :			Union[str, Any]    )->List[str]:
       A__		   =		tf.convert_to_tensor(UpperCamelCase__    )
       A__		   =		tf.cast(1.702					,	x.dtype    )
       return x * tf.math.sigmoid(coeff * x    )


def       UpperCamelCase__(			UpperCamelCase__     :			Optional[int]    )->Dict:
       return tf.clip_by_value(_gelu(UpperCamelCase__    )					,	-10					,	10    )


def       UpperCamelCase__(			UpperCamelCase__     :			Any					,	UpperCamelCase__     :			Optional[int]=-1    )->str:
       A__   ,      A__		   =		tf.split(UpperCamelCase__					,	2					,	axis=UpperCamelCase__    )
       return a * tf.math.sigmoid(UpperCamelCase__    )


if version.parse(tf.version.VERSION) >= version.parse('2.4'):


       def       UpperCamelCase__(			UpperCamelCase__     :			Any    )->List[str]:
              return tf.keras.activations.gelu(UpperCamelCase__					,	approximate=UpperCamelCase__    )

       a__: List[str]							   =						tf.keras.activations.gelu
       a__: List[str]							   =						approximate_gelu_wrap
else:
       a__: Tuple							   =						_gelu
       a__: Optional[int]							   =						_gelu_new


a__: Union[str, Any]							   =						{
    'gelu': gelu,
    'gelu_10': gelu_aa,
    'gelu_fast': gelu_fast,
    'gelu_new': gelu_new,
    'glu': glu,
    'mish': mish,
    'quick_gelu': quick_gelu,
    'relu': tf.keras.activations.relu,
    'sigmoid': tf.keras.activations.sigmoid,
    'silu': tf.keras.activations.swish,
    'swish': tf.keras.activations.swish,
    'tanh': tf.keras.activations.tanh,
}


def       UpperCamelCase__(			UpperCamelCase__     :			Optional[Any]    )->Any:
       if activation_string in ACTaFN:
              return ACTaFN[activation_string]
       else:
              raise KeyError(f"function {activation_string} not found in ACT2FN mapping {list(ACTaFN.keys()    )}"    )












import itertools
import math


def       UpperCamelCase__(			UpperCamelCase__     :			int    )->bool:

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or number % 2 == 0 or number % 3 == 0:
              # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
              return False

       # All primes number are in format of 6k +/- 1
       for i in range(5					,	int(math.sqrt(UpperCamelCase__    ) + 1    )					,	6    ):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True


def       UpperCamelCase__(			)->Tuple:
       A__		   =		2
       while True:
              if is_prime(UpperCamelCase__    ):
                     yield num
              num += 1


def       UpperCamelCase__(			UpperCamelCase__     :			int = 1_00_01    )->int:
       return next(itertools.islice(prime_generator()					,	nth - 1					,	UpperCamelCase__    )    )


if __name__ == "__main__":
       print(F"{solution() = }")





