"""simple docstring"""




import math

import tensorflow as tf
from packaging import version





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Optional[int]	)       ->      Tuple:
  _lowerCAmelCase						:       Any  			=     tf.convert_to_tensor(_lowerCamelCase	)
  _lowerCAmelCase						:       Optional[Any]  			=     0.5 * (1.0 + tf.math.erf(x / tf.cast(tf.sqrt(2.0	)			,x.dtype	)	))

  return x * cdf





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Optional[Any]	)       ->      str:
  _lowerCAmelCase						:       str  			=     tf.convert_to_tensor(_lowerCamelCase	)
  _lowerCAmelCase						:       Optional[Any]  			=     tf.cast(math.pi			,x.dtype	)
  _lowerCAmelCase						:       int  			=     tf.cast(0.04_47_15			,x.dtype	)
  _lowerCAmelCase						:       Tuple  			=     0.5 * (1.0 + tf.tanh(tf.sqrt(2.0 / pi	) * (x + coeff * tf.pow(_lowerCamelCase			,3	))	))

  return x * cdf





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Union[str, Any]	)       ->      List[Any]:
  _lowerCAmelCase						:       Optional[int]  			=     tf.convert_to_tensor(_lowerCamelCase	)

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





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       List[Any]	)       ->      Union[str, Any]:
  _lowerCAmelCase						:       Union[str, Any]  			=     tf.convert_to_tensor(_lowerCamelCase	)
  _lowerCAmelCase						:       Tuple  			=     tf.cast(0.04_47_15			,x.dtype	)
  _lowerCAmelCase						:       Union[str, Any]  			=     tf.cast(0.79_78_84_56_08			,x.dtype	)

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





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Any	)       ->      Optional[int]:
  _lowerCAmelCase						:       Optional[Any]  			=     tf.convert_to_tensor(_lowerCamelCase	)
  _lowerCAmelCase						:       Tuple  			=     tf.cast(1.7_02			,x.dtype	)
  return x * tf.math.sigmoid(coeff * x	)





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       int	)       ->      Dict:
  return tf.clip_by_value(_gelu(_lowerCamelCase	)			,-10			,10	)





def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Tuple			,_lowerCamelCase						:       Dict=-1	)       ->      List[Any]:
  _lowerCAmelCase			,	_lowerCAmelCase						:       Dict  			=     tf.split(_lowerCamelCase			,2			,axis=_lowerCamelCase	)
  return a * tf.math.sigmoid(_lowerCamelCase	)


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





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

     _a      :		Optional[int]           =   tf.keras.activations.gelu






     _a      :		Any           =   approximate_gelu_wrap
else:
     _a      :		Dict           =   _gelu
     _a      :		int           =   _gelu_new


_a      :		Dict           =   {
    '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 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       str	)       ->      List[str]:
  if activation_string in ACTaFN:
    return ACTaFN[activation_string]
  else:
    raise KeyError(f"function {activation_string} not found in ACT2FN mapping {list(ACTaFN.keys()	)}"	)





"""simple docstring"""




# NOTE: This file is deprecated and will be removed in a future version.
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works
from ...utils import deprecate
from ..controlnet.multicontrolnet import MultiControlNetModel  # noqa: F401
from ..controlnet.pipeline_controlnet import StableDiffusionControlNetPipeline  # noqa: F401


deprecate(
    'stable diffusion controlnet',
    '0.22.0',
    'Importing `StableDiffusionControlNetPipeline` or `MultiControlNetModel` from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet is deprecated. Please import `from diffusers import StableDiffusionControlNetPipeline` instead.',
    standard_warn=False,
    stacklevel=3,
)




