a
    Sic	                     @   sb   d Z ddlm  mZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ edG dd	 d	eZdS )
z3Thresholded Rectified Linear Unit activation layer.    N)backend)Layer)tf_utils)keras_exportzkeras.layers.ThresholdedReLUc                       sD   e Zd ZdZd fdd	Zdd Z fddZejd	d
 Z	  Z
S )ThresholdedReLUa  Thresholded Rectified Linear Unit.

    It follows:

    ```
      f(x) = x for x > theta
      f(x) = 0 otherwise`
    ```

    Input shape:
      Arbitrary. Use the keyword argument `input_shape`
      (tuple of integers, does not include the samples axis)
      when using this layer as the first layer in a model.

    Output shape:
      Same shape as the input.

    Args:
      theta: Float >= 0. Threshold location of activation.
          ?c                    sT   t  jf i | |d u r(td| |dk r>td| d| _t|| _d S )NzOTheta of a Thresholded ReLU layer cannot be None, expecting a float. Received: r   zEThe theta value of a Thresholded ReLU layer should be >=0. Received: T)super__init__
ValueErrorsupports_maskingr   cast_to_floatxtheta)selfr   kwargs	__class__ d/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/layers/activation/thresholded_relu.pyr	   3   s    zThresholdedReLU.__init__c                 C   s    | j }|tt|| j| S N)compute_dtypetfcastgreaterr   )r   inputsdtyper   r   r   callB   s    zThresholdedReLU.callc                    s4   dt | ji}t  }tt| t|  S )Nr   )floatr   r   
get_configdictlistitems)r   configbase_configr   r   r   r   F   s    
zThresholdedReLU.get_configc                 C   s   |S r   r   )r   input_shaper   r   r   compute_output_shapeK   s    z$ThresholdedReLU.compute_output_shape)r   )__name__
__module____qualname____doc__r	   r   r   r   shape_type_conversionr$   __classcell__r   r   r   r   r      s   r   )r(   tensorflow.compat.v2compatv2r   kerasr   keras.engine.base_layerr   keras.utilsr    tensorflow.python.util.tf_exportr   r   r   r   r   r   <module>   s   