
    AVh                     h    d Z ddlZddlmZ ddlmZ  ed       G d dej                               Zy)z Utilities for reduce operations.    N)variable_scope)	tf_exportzdistribute.ReduceOpc                   (    e Zd ZdZdZdZed        Zy)ReduceOpzIndicates how a set of values should be reduced.

  * `SUM`: Add all the values.
  * `MEAN`: Take the arithmetic mean ("average") of the values.
  SUMMEANc                     t         j                  j                  t        j                  t         j                  j                  t        j                  i}|j                  |       }|st        d| z        |S )NzRCould not convert from `tf.VariableAggregation` %s to`tf.distribute.ReduceOp` type)r   VariableAggregationr   r   r   get
ValueError)aggregationmapping	reduce_ops      X/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/distribute/reduce_util.pyfrom_variable_aggregationz"ReduceOp.from_variable_aggregation$   sk     	**..**//G
 K(I 79DE F F    N)__name__
__module____qualname____doc__r   r   staticmethodr    r   r   r   r      s%     	#	$
 
r   r   )r   enumtensorflow.python.opsr    tensorflow.python.util.tf_exportr   Enumr   r   r   r   <module>r      s8    '  0 6  !tyy  "r   