
    &`iu                         d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
  e            \  ZZZ G d derej        j        j        ne          ZdS )	    )AnyOptional)deprecation_warning)try_import_tf)
TensorType)log_oncec                   J     e Zd ZdZd	dedee         f fdZdedefdZ xZ	S )
SkipConnectionzSkip connection layer.

    Adds the original input to the output (regular residual layer) OR uses
    input as hidden state input to a given fan_in_layer.
    Nlayerfan_in_layerc                     t          d          rt          d            t                      j        di | || _        || _        dS )a?  Initializes a SkipConnection keras layer object.

        Args:
            layer (tf.keras.layers.Layer): Any layer processing inputs.
            fan_in_layer (Optional[tf.keras.layers.Layer]): An optional
                layer taking two inputs: The original input and the output
                of `layer`.
        skip_connectionz%rllib.models.tf.layers.SkipConnection)oldN )r   r   super__init___layer_fan_in_layer)selfr   r   kwargs	__class__s       ~/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/rllib/models/tf/layers/skip_connection.pyr   zSkipConnection.__init__   sd     %&& 	;    	""6""")    inputsreturnc                 j     | j         |fi |}| j        ||z   }n|                     ||f          }|S N)r   r   )r   r   r   outputss       r   callzSkipConnection.call#   sO    $+f////%&GG ((&'):;;Gr   r   )
__name__
__module____qualname____doc__r   r   r   r   r   __classcell__)r   s   @r   r
   r
      s         * *c *# * * * * * *": J        r   r
   N)typingr   r   ray._common.deprecationr   ray.rllib.utils.frameworkr   ray.rllib.utils.typingr   ray.utilr   tf1tftfvkeraslayersLayerobjectr
   r   r   r   <module>r1      s                    7 7 7 7 7 7 3 3 3 3 3 3 - - - - - -      }R# # # # #b<RX_**f # # # # #r   