
    AVh	                     d    d Z ddlZddlZddl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Zy)
z,Utility ops shared across tf.contrib.signal.    N)ops)tensor_util)	array_ops)math_ops)
while_loopc                 F   t        j                  |d| |g      5  t        j                  |       } t        j                  |      }| j                  j	                  d       |j                  j	                  d       | j
                  j                  st        d| j
                  z        |j
                  j                  st        d|j
                  z        t        j                  |       }t        j                  |      }|e|ct        j                  j                  dk  rt        j                  }nt        j                  }t        j                   |||            cddd       S d }d }t!        j                   ||| |gd	
      \  } }| cddd       S # 1 sw Y   yxY w)az  Returns the greatest common divisor via Euclid's algorithm.

  Args:
    a: The dividend. A scalar integer `Tensor`.
    b: The divisor. A scalar integer `Tensor`.
    name: An optional name for the operation.

  Returns:
    A scalar `Tensor` representing the greatest common divisor between `a` and
    `b`.

  Raises:
    ValueError: If `a` or `b` are not scalar integers.
  gcdr   z"a must be an integer type. Got: %sz"b must be an integer type. Got: %sN   c                 T    t        j                  |t        j                  |            S N)r   greaterr   
zeros_like)_bs     U/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/signal/util_ops.py<lambda>zgcd.<locals>.<lambda>B   s    ((I,@,@,CD     c                 2    |t        j                  | |      gS r   )r   mod)ar   s     r   r   zgcd.<locals>.<lambda>C   s    HLLA./ r   F)	back_prop)r   
name_scopeconvert_to_tensorshapeassert_has_rankdtype
is_integer
ValueErrorr   constant_valuesysversion_infomajor	fractionsr	   mathr   )r   r   nameconst_aconst_bmath_gcdcondbodys           r   r	   r	      sU    ~~dEAq6* a Aa AGGAGGA77;aggEFF77;aggEFF ((+G((+Gw2					!	#==88""8GW#=>+ . ED/D  taVuEDAq5  s   EF(%FF r   )__doc__r#   r$   r    tensorflow.python.frameworkr   r   tensorflow.python.opsr   r   r   r	    r   r   <module>r/      s'    3   
 + 3 + * ,)r   