a
    Sicډ                     @   s  d Z ddlZddlZddlm  m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 ddlmZ ddlmZ e ZdJd	d
Zde	jddddddde	jje	jjddfddZdd Zdd Zdd Z dd Z!dZ"dd Z#dd Z$dKddZ%dd Z&dd  Z'd!d" Z(d#d$ Z)d%d& Z*d'd( Z+e	j,-e+ G d)d* d*Z.G d+d, d,Z/d-d. Z0d/d0 Z1d1d2 Z2dLd4d5Z3d6d7 Z4da5ed8gd9d:d; Z6ed<gd9d=d> Z7d?d@ Z8G dAdB dBZ9dCdD Z:dEdF Z;dGdH Z<dIZ=dS )Mz?Contains private utilities used mainly by the base Layer class.    N)backend)dtensor_api)control_flow_util)
tf_inspect)tf_utils)keras_exportc                 C   s(   ddl m} |j|| jd}||| fS )Nr   )metrics)namedtype)kerasr   Meanr
   )valuer	   metrics_module
metric_obj r   Y/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/engine/base_layer_utils.pycreate_mean_metric#   s    r   Tc                 C   s   d}|durt |sd}|r&|}d}n>t|r6| }|rNtj||||d}ntj|||d}|j}t|}|du rzd}|du rtj	|| |||||||	|
||r|nddS t
j|| ||||||	|
||r|nddS dS )a  Temporary util to create a variable (relies on `variable_scope.variable`).

    Some reuse-related technicalities prevent us from using
    `variable_scope.get_variable()` directly, so we use a subcomponent
    that has fewer constraints (`variable_scope.variable()`).

    In the longer term, it seems like a similar "default variable creator"
    method should exist in `Trackable` instead. When this happens, we can get
    rid of this temporary solution.

    TODO(fchollet): remove this method when no longer needed.

    Args:
      name: Variable name.
      shape: Variable shape.
      dtype: The type of the variable. Defaults to `self.dtype` or `float32`.
      initializer: Initializer instance (callable).
      trainable: Whether the variable should be part of the layer's
        "trainable_variables" (e.g. variables, biases)
        or "non_trainable_variables" (e.g. BatchNorm mean, stddev).
        Note, if the current variable scope is marked as non-trainable
        then this parameter is ignored and any added variables are also
        marked as non-trainable. `trainable` defaults to `True` unless
        `synchronization` is set to `ON_READ`.
      caching_device: Passed to `tf.Variable`.
      validate_shape: Passed to `tf.Variable`.
      constraint: Constraint instance (callable).
      use_resource: Whether to use a `ResourceVariable`.
      collections: List of graph collections keys. The new variable is added to
        these collections. Defaults to `[GraphKeys.GLOBAL_VARIABLES]`.
      synchronization: Indicates when a distributed a variable will be
        aggregated. Accepted values are constants defined in the class
        `tf.VariableSynchronization`. By default the synchronization is set to
        `AUTO` and the current `DistributionStrategy` chooses
        when to synchronize. If `synchronization` is set to `ON_READ`,
        `trainable` must not be set to `True`.
      aggregation: Indicates how a distributed variable will be aggregated.
        Accepted values are constants defined in the class
        `tf.VariableAggregation`.
      partitioner: Not handled at this time.
      layout: the optional DTensor layout, used for creating DVariable.

    Returns:
      Variable instance.
    FNT)r
   layout)r
   )initial_valuer	   	trainablecaching_devicer
   validate_shape
constraintuse_resourcecollectionssynchronizationaggregationshape)r   r	   r   r   r
   r   r   r   r   r   r   )callabler   isclass	functoolspartial
base_dtypetfTensorShapetf1Variabledtensor	DVariable)r	   r   r
   initializerr   r   r   r   r   r   r   r   partitionerr   initializing_from_valueinit_valvariable_dtypevariable_shaper   r   r   make_variable,   sZ    =



r/   c                 C   s   dd }t j|| S )zRetrieves the output mask(s) of the previous node.

    Args:
        input_tensors: An arbitrary structure of Tensors.

    Returns:
        A mask tensor or list of mask tensors.
    c                 S   s   t | dd S )N_keras_maskgetattr)xr   r   r   _collect_previous_mask   s    z5collect_previous_mask.<locals>._collect_previous_maskr#   nestmap_structure)input_tensorsr4   r   r   r   collect_previous_mask   s    
r9   c                 C   s   t dd tj| D S )Nc                 s   s   | ]}t |d V  qdS _keras_historyNhasattr.0r3   r   r   r   	<genexpr>       z*have_all_keras_metadata.<locals>.<genexpr>)allr#   r6   flatten)tensorsr   r   r   have_all_keras_metadata   s    rE   c                 C   s   t j| t dS )N)r   r
   )r%   placeholderr   floatx)r   r   r   r    generate_placeholders_from_shape   s    rH   c                 C   s   t | t g \}}|S )a!  Wraps TensorFlow Operations for compatibility with the Functional API.

    This method checks to see if a Tensor in `tensors` is missing Keras metadata
    and has its origin in a Keras `Input` Layer. If so, this method will replace
    the raw TensorFlow Operations that created this tensor with
    `TensorFlowOpLayer` instances that create identical operations.

    Any Tensors not originating from a Keras `Input` Layer will be treated as
    constants when constructing `TensorFlowOpLayer` instances.

    Args:
      tensors: A structure of Tensors, some of which come from raw TensorFlow
        operations and need to have Keras metadata assigned to them.

    Returns:
      created_layers: List. The `TensorFlowOpLayer` instances created to wrap
        the raw Tensorflow operations.
    )_create_keras_history_helperset)rD   _created_layersr   r   r   create_keras_history   s    rM   Fc              
   C   s  t  rtdddlm} tj| }g }g }|D ]l}t|dddurLq4t	|tj
t jfrl||j q4t|r|| q4|j}||vr4t|j}	i }
g }t|	D ]\}}t|r|| qtj ot   }tt  }|s|str ||
|< qt $ tg |g |
|< W d   q1 s40    Y  qt|}t|||\}}|j}|j ! }|j"||
|d}|| |j#|fi |j$d |%|g q4|s|rd}td	j&|t'|t'|d
||fS )a$  Helper method for `create_keras_history`.

    Args:
      tensors: A structure of Tensors for which to create Keras metadata.
      processed_ops: Set. TensorFlow operations that have already been wrapped
        in `TensorFlowOpLayer` instances.
      created_layers: List. The `TensorFlowOpLayer` instances created.

    Returns:
      Tuple. First element is the updated set of TensorFlow Operations that
      have been wrapped in `TensorFlowOpLayer` instances. Second element is
      a list of the `TensorFlowOpLayer` instances created.
    zB`create_keras_history` should only be called if eager is disabled!r   )
base_layerr;   N)	constantsr	   )argskwargsoutputsz
    weights_mult = lambda x: tf.sparse.sparse_dense_matmul(x, weights)
    output = tf.keras.layers.Lambda(weights_mult)(input)
    a  Tensorflow ops that generate ragged or sparse tensor outputs are currently not supported by Keras automatic op wrapping. Please wrap these ops in a Lambda layer: 

```
{example}
```
Sparse ops encountered: {sparse_ops}
Ragged tensors encountered: {ragged_tensors}
)example
sparse_opsragged_tensors)(r%   #executing_eagerly_outside_functions
ValueErrorkeras.enginerN   r#   r6   rC   r2   
isinstanceSparseTensorSparseTensorValueappendopr   	is_raggedlistinputs	enumerateuses_keras_history
distributein_cross_replica_contextr   GraphOrParentsInXlaContextget_default_graph_UNSAFE_GRAPH_OP_LAYER_CREATION
init_scoper   functionunnest_if_single_tensorrI   r	   node_defSerializeToStringTensorFlowOpLayer_set_connectivity_metadatarR   updateformatstr)rD   processed_opsrL   rN   tensor_listrT   rU   tensorr]   	op_inputsrO   layer_inputsiop_inputds_with_session	using_xlar	   rk   op_layerlambda_exampler   r   r   rI      s    




	

6


rI   c                 C   s.   t j| }t| ts*t|dkr*|d } | S )N   r   )r#   r6   rC   rY   dictlen)r8   flat_input_tensorsr   r   r   rj   F  s    rj   c                 C   s:   t j| }t jr|sdS tdd |D r2dS t| S )a  Check if any Tensors need to be wrapped in TensorFlowOpLayers.

    This will never return True inside a sublayer, because sublayers
    do not need to create Keras History. Otherwise, this returns True
    if one or more of `tensors` originates from a `keras.Input` and
    does not have `_keras_history` set.

    Args:
      tensors: An arbitrary nested structure of Tensors.
      ignore_call_context: Whether to ignore the check of if currently
        outside of a `call` context. This is `True` when creating
        KerasHistory inside `Node`, where we always know that Tensors
        are being used with the Functional API.

    Returns:
      Bool, whether at least one Tensor needs to be wrapped.
    Fc                 s   s   | ]}t |d dduV  qdS r:   r1   )r?   rt   r   r   r   r@   f  s   z&needs_keras_history.<locals>.<genexpr>)r#   r6   rC   call_contextin_callrB   rb   )rD   ignore_call_contextr8   r   r   r   needs_keras_historyQ  s    r   c                   C   s   t  jS )z7Returns if currently executing inside of a Keras graph.)r   in_keras_graphr   r   r   r   is_in_keras_grapho  s    r   c                   C   s   t  pt S )z4Returns if in eager mode or inside of a tf.function.)r#   executing_eagerlyis_in_tf_functionr   r   r   r   is_in_eager_or_tf_functiont  s    r   c                  C   sJ   t  sdS t sdS t r"dS t  } t| ddrF| jdrFdS dS )z#Returns if inside of a tf.function.Fr	   wrapped_functionT)	r%   rV   r#   inside_functionr   rf   r2   r	   
startswith)graphr   r   r   r   y  s    r   c              	   C   s   t  }tj| }|rg }|D ]n}t||v r0q|t| t|dddurPqt|dddurf dS z||jj	 W q t
y   Y q0 q|}qt|  dS )a*  Check if at least one Tensor originates from a `keras.Input`.

    This is `True` if at least one Tensor has its origin in a `keras.Input`.
    Any Tensor that originates from a `keras.Input` will have a dependency
    Tensor with a `_keras_history` attribute attached. Tensors that have
    already been checked to not originate from a `keras.Input`
    are marked as `_keras_history_checked`.

    Args:
      tensors: An arbitrary nested structure of Tensors.

    Returns:
      Bool, whether at least one Tensor originates from a `keras.Input`.
    _keras_history_checkedNr;   TF)rJ   r#   r6   rC   idaddr2   extendr]   r`   AttributeErrormark_checked)rD   checked_tensorstensors_to_checknew_tensors_to_checkrt   r   r   r   rb     s&    rb   c                 C   s   dd }t j||  dS )zMarks that these Tensors should not be tracked.

    This prevents Layers from attempting to create TensorFlowOpLayers
    for these Tensors.

    Args:
      tensors: An arbitrary structure of Tensors.
    c                 S   s
   d| _ d S )NT)r   rt   r   r   r   _mark_checked  s    z#mark_checked.<locals>._mark_checkedNr5   )rD   r   r   r   r   r     s    
r   c                  C   s$   t tdd} | du r t } | t_| S )z'Returns currently active `CallContext`.r   N)r2   _call_contextCallContextr   )call_ctxr   r   r   r     s
    r   c                   @   sv   e Zd ZdZdd ZdddZedd Zed	d
 Zedd Z	edd Z
edd Zedd Zedd ZdS )r   as  Keeps track of properties currently inside a Layer/Model's `call`.

    Attributes:
      in_call: Whether currently inside the `call` of a Layer.
      layer: The `Layer` whose `call` is currently active.
      inputs: The inputs to the currently active `Layer`.
      build_graph: Whether currently inside a Graph or FuncGraph.
      training: Whether currently executing in training or inference mode.
      saving: Whether currently saving to SavedModel.
      frozen: Whether currently executing inside a `Layer` with `trainable` set
        to `False`.
      in_keras_graph: Whether executing inside the Keras Graph.
    c                 C   s"   d| _ d d dd d d| _d| _d S )NFlayerr`   build_graphtrainingsaving)r   _state_in_keras_graphselfr   r   r   __init__  s    	zCallContext.__init__Nc                 C   s   |||||d}t | |S )a  Push a Layer and its inputs and state onto the current call context.

        Args:
          layer: The `Layer` whose `call` is currently active.
          inputs: The inputs to the currently active `Layer`.
          build_graph: Whether currently inside a Graph or FuncGraph.
          training: Whether currently executing in training or inference mode.
          saving: Whether currently saving to SavedModel.

        Returns:
          Context manager.
        r   )CallContextManager)r   r   r`   r   r   r   stater   r   r   enter  s    zCallContext.enterc                 C   s
   | j d S )Nr   r   r   r   r   r   r     s    zCallContext.layerc                 C   s
   | j d S )Nr`   r   r   r   r   r   r`     s    zCallContext.inputsc                 C   s
   | j d S Nr   r   r   r   r   r   r     s    zCallContext.build_graphc                 C   s
   | j d S )Nr   r   r   r   r   r   r     s    zCallContext.trainingc                 C   s
   | j d S )Nr   r   r   r   r   r   r     s    zCallContext.savingc                 C   s   | j d }|sdS |j S )Nr   F)r   r   )r   r   r   r   r   frozen  s    
zCallContext.frozenc                 C   s&   t  rdS | jp$tt dd dkS )NFr	   keras_graph)r#   r   r   r2   r   	get_graphr   r   r   r   r   &  s
    zCallContext.in_keras_graph)N)__name__
__module____qualname____doc__r   r   propertyr   r`   r   r   r   r   r   r   r   r   r   r     s"   






r   c                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	r   z"Context manager for `CallContext`.c                 C   s   || _ || _|d | _d S r   )	_call_ctxr   _build_graph)r   r   r   r   r   r   r   5  s    zCallContextManager.__init__c                 C   sR   | j }|j| _|j| _d|_| j|_| jrN|j| _|jpJtt	
 dd dk|_d S )NTr	   r   )r   r   _prev_in_callr   _prev_stater   r   _prev_in_keras_graphr2   r   r   )r   r   r   r   r   	__enter__:  s    zCallContextManager.__enter__c                 G   s(   | j }| j|_| j|_| jr$| j|_d S N)r   r   r   r   r   r   r   r   )r   exc_infor   r   r   r   __exit__K  s
    zCallContextManager.__exit__N)r   r   r   r   r   r   r   r   r   r   r   r   2  s   r   c                 C   s6   t t| jdd |}|| d|v o4|d duS )zDReturns whether a user passed the `training` argument in `__call__`.   Nr   )r~   ziprP   ro   )argspecrP   rQ   	full_argsr   r   r   training_arg_passed_to_callT  s    
r   c                 C   s    | j ddko| j ddkS )zEReturns True if the object is a subclassed layer or subclassed model.zkeras.enginezkeras.layersr   findr   r   r   r   is_subclassed\  s    r   c                 C   s   | j ddkS )z6Returns whether the layer is loaded from a SavedModel.zkeras.saving.saved_modelr   r   r   r   r   r   from_saved_modeld  s    r   add_lossc                 C   s   |st  rt| dr| jjr|dkrDd}d}td| d| d|dkrVd	}d
}n|dkrhd}d}nd}d}tdj|||ddS )ag  Checks that tensors passed to `add_*` method match the Keras graph.

    When one of the `add_*` method is called inside a V2 conditional branch, the
    underlying tensor gets created in a FuncGraph managed by control_flow_v2.
    We need to raise clear error messages in such cases.

    Args:
      tensor: Tensor to check, or `False` if it is known that an error
        should be raised.
      method: Caller method, one of {'add_metric', 'add_loss', 'add_update'}.
      force_raise: If an error should be raised regardless of `tensor`.

    Raises:
      RuntimeError: In case of an out-of-graph tensor.
    r   activity_regularizerag  
      class TestModel(tf.keras.Model):

        def __init__(self):
          super(TestModel, self).__init__(name='test_model')
          self.dense = tf.keras.layers.Dense(2, activity_regularizer='l2')

        def call(self, x, training=None):
          if training:
            return self.dense(x)
          else:
            return self.dense(x)
      a  
      class TestModel(tf.keras.Model):

        def __init__(self):
          super(TestModel, self).__init__(name='test_model')
          self.dense = tf.keras.layers.Dense(2, activity_regularizer='l2')

        def call(self, x, training=None):
          return self.dense(x)
      zRYou are using a layer with `activity_regularizer` in a control flow branch, e.g.:
z
This is currently not supported. Please move your call to the layer with `activity_regularizer` out of the control flow branch, e.g.:
aC  
You can also resolve this by marking your outer model/layer dynamic (eager-only) by passing `dynamic=True` to the layer constructor. Any kind of control flow is supported with dynamic layers. Note that using `dynamic=True` requires you to implement static shape inference in the `compute_output_shape(input_shape)` method.
add_metricz
      def call(self, inputs, training=None):
        if training:
          metric = compute_metric(inputs)
          self.add_metric(metric, name='my_metric', aggregation='mean')
        return inputs
      z
      def call(self, inputs, training=None):
        if training:
          metric = compute_metric(inputs)
        else:
          metric = 0.
        self.add_metric(metric, name='my_metric', aggregation='mean')
        return inputs
      r   z
      def call(self, inputs, training=None):
        if training:
          loss = compute_loss(inputs)
          self.add_loss(loss)
        return inputs
      z
      def call(self, inputs, training=None):
        if training:
          loss = compute_loss(inputs)
        else:
          loss = 0.
        self.add_loss(loss)
        return inputs
      z
      def call(self, inputs, training=None):
        if training:
          self.add_update(self.w.assign_add(1))
        return inputs
      z
      def call(self, inputs, training=None):
        if training:
          increment = 1
        else:
          increment = 0
        self.add_update(self.w.assign_add(increment))
        return inputs
      a  You are using the method `{method}` in a control flow branch in your layer, e.g.:
{bad_example}
This is not currently supported. Please move your call to {method} out of the control flow branch, e.g.:
{correct_example}
You can also resolve this by marking your layer as dynamic (eager-only) by passing `dynamic=True` to the layer constructor. Any kind of control flow is supported with dynamic layers. Note that using `dynamic=True` requires you to implement static shape inference in the `compute_output_shape(input_shape)` method.)methodbad_examplecorrect_exampleN)r%   rV   r=   r   is_control_flow_graphRuntimeErrorrp   )rt   r   force_raiser   r   r   r   r   check_graph_consistencyi  s@    
	
	r   c                    s    fdd}t j|| S )z@Marks `outputs` as the return values for automatic control deps.c                    sZ   t | s| S  | }t| dddur8 | j|_nd|_t| dddurV| j|_|S )z>Marks `tensor` as the return value for automatic control deps.r0   N_tfp_distribution)r#   	is_tensormark_as_returnr2   r0   r   )rt   return_tensoracdr   r   _mark_as_return  s    

z'mark_as_return.<locals>._mark_as_returnr5   )rR   r   r   r   r   r   r     s    r   z%keras.layers.enable_v2_dtype_behavior)v1c                   C   s   da dS )a  Enable the V2 dtype behavior for Keras layers.

    By default, the V2 dtype behavior is enabled in TensorFlow 2, so this
    function is only useful if `tf.compat.v1.disable_v2_behavior` has been
    called. Since mixed precision requires V2 dtype behavior to be enabled, this
    function allows you to use mixed precision in Keras layers if
    `disable_v2_behavior` has been called.

    When enabled, the dtype of Keras layers defaults to floatx (which is
    typically float32) instead of None. In addition, layers will automatically
    cast floating-point inputs to the layer's dtype.

    >>> x = tf.ones((4, 4, 4, 4), dtype='float64')
    >>> layer = tf.keras.layers.Conv2D(filters=4, kernel_size=2)
    >>> print(layer.dtype)  # float32 since V2 dtype behavior is enabled
    float32
    >>> y = layer(x)  # Layer casts inputs since V2 dtype behavior is enabled
    >>> print(y.dtype.name)
    float32

    A layer author can opt-out their layer from the automatic input casting by
    passing `autocast=False` to the base Layer's constructor. This disables the
    autocasting part of the V2 behavior for that layer, but not the defaulting
    to floatx part of the V2 behavior.

    When a global `tf.keras.mixed_precision.Policy` is set, a Keras layer's
    dtype will default to the global policy instead of floatx. Layers will
    automatically cast inputs to the policy's compute_dtype.
    TNV2_DTYPE_BEHAVIORr   r   r   r   enable_v2_dtype_behavior  s     r   z&keras.layers.disable_v2_dtype_behaviorc                   C   s   da dS )ztDisables the V2 dtype behavior for Keras layers.

    See `tf.compat.v1.keras.layers.enable_v2_dtype_behavior`.
    FNr   r   r   r   r   disable_v2_dtype_behavior(  s    r   c                   C   s   t du rtjj S t S )z1Returns True if the V2 dtype behavior is enabled.N)r   r#   __internal__tf2enabledr   r   r   r   v2_dtype_behavior_enabled2  s    r   c                   @   s<   e Zd ZdZdd Zedd Zdd Zdd	 Zd
d Z	dS )TrackableWeightHandlera  Keras wrapper for handling tracking.Trackable object saving and restoring.

    This class handles Trackables in both V1 and V2 modes, ensuring that they
    can be saved and restored with the correct data and without adding
    additional ops on every save.

    Attributes:
      trackable: The trackable to wrap.
      num_tensors: The number of tensors that this trackable requires for
        saving.
    c                    sH  t |tjjjst| d| _tj  _	tjj
| }|sbd _dd  _dd  _nt|dkr*t|d }t r| _t  j _ fdd _ fdd _npg  _|  _t jj _ jjD ]"}|j} jt|j|j q܈ j jd  _ j _ fd	d _ntd
| dt| dd S )Nz is not a Trackable object.r   c                 S   s   d S r   r   weightsr   r   r   <lambda>S  rA   z1TrackableWeightHandler.__init__.<locals>.<lambda>c                   S   s   g S r   r   r   r   r   r   r   T  rA   r}   c                    s      | d S r   )	_saveablerestorer   r   r   r   r   a  s   c                      s   dd    jD S )Nc                 S   s   g | ]
}|j qS r   r   r?   specr   r   r   
<listcomp>d  s   ETrackableWeightHandler.__init__.<locals>.<lambda>.<locals>.<listcomp>r   specsr   r   r   r   r   d  s   c                      s   dd  j jD S )Nc                 S   s   g | ]
}|j qS r   r   r   r   r   r   r   x  s   r   r   r   r   r   r   r   x  s   z?Only Trackables with one Saveable are supported. The Trackable z has z Saveables.)rY   r#   r   tracking	TrackablerW   
_trackablerc   get_strategy_distribute_strategysaveable_objects_from_trackablevalues_num_tensors_setter_getterr   r_   r%   rV   r   r   _placeholder_tensorsrt   r\   rF   r
   r   r   
_assign_op_set_weights_v1)r   	trackable	saveablessaveabler   rt   r   r   r   r   F  sL    
zTrackableWeightHandler.__init__c                 C   s   | j S r   )r   r   r   r   r   num_tensors  s    z"TrackableWeightHandler.num_tensorsc                 C   s@   t || jkr2td| j d| j dt | d| | d S )NzWeight handler for trackable z3 received an incorrect number of weights: expected z weights, got z	 weights.)r   r   rW   r   r   )r   r   r   r   r   set_weights  s    
z"TrackableWeightHandler.set_weightsc                 C   s   |   S r   )r   r   r   r   r   get_tensors  s    z"TrackableWeightHandler.get_tensorsc                 C   s:   i }t |D ]\}}||| j| < qt | j| d S r   )ra   r   r   get_sessionrunr   )r   r   	feed_dictidxrt   r   r   r   r     s    z&TrackableWeightHandler._set_weights_v1N)
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   9  s   ;

r   c                 C   s8   t j| }tdd |D r4td| d|  dd S )Nc                 s   s   | ]}t |tjV  qd S r   )rY   r#   RaggedTensorr>   r   r   r   r@     rA   z$no_ragged_support.<locals>.<genexpr>zLayer z; does not support RaggedTensors as input. Inputs received: z@. You can try converting your input to a dense (uniform) tensor.)r#   r6   rC   anyrW   )r`   
layer_name
input_listr   r   r   no_ragged_support  s    r  c                 C   s   t | dpt | dS )z@Returns True if `v` is a PartionedVariable or a ShardedVariable._variable_list
_variablesr<   )vr   r   r   is_split_variable  s    r  c                 C   s(   t | }t|do&t|do&t| t  S )Ntrainable_weightsnon_trainable_weights)typer=   rY   )objobj_typer   r   r   has_weights  s    

r  z8This layer's losses have been added to the parent layer.)N)F)Nr   F)>r   r    	threadingtensorflow.compat.v1compatr   r%   tensorflow.compat.v2v2r#   r   r   keras.dtensorr   r'   keras.utilsr   r   r    tensorflow.python.util.tf_exportr   localr   r   float32VariableSynchronizationAUTOVariableAggregationNONEr/   r9   rE   rH   rM   rg   rI   rj   r   r   r   r   rb   r   r   r   register_call_context_functionr   r   r   r   r   r   r   r   r   r   r   r   r  r  r  REVIVED_LOSS_PLACEHOLDERr   r   r   r   <module>   sz   

x!f
-["
 

"

	`
