code: def atan2_tflite(y, x, n=100, dtype=tf.float32):
      """Approximation to the atan2 function
  
          atan is not a tflite supported op or flex op, thus this uses an Approximation
          Poor accuracy when either x is very small or y is very large.
          https://en.wikipedia.org/wiki/Atan2
  
      Args:
          y (tensor) - vertical component of tangent (or imaginary part of number for phase)
          x (tensor) - horizontal component of tangent (or real part of number for phase)
          n (int) - The number of iterations to use for atan approximations,
              larger means arctan is more accurate
          dtype (tf.dtype) - tf.float32, or tf.float64
  
      Returns
          atan2(x) (tensor) - approx value of atan2(x)
      """
      pi = tf.zeros(tf.shape(x), dtype) + tf.cast(np.pi, dtype)
      zeros = tf.zeros(tf.shape(x), dtype)
      atan2 = continued_fraction_arctan(y / x, n, dtype)
      atan2 = tf.where(x > 0, atan2, atan2)  # implicit
      atan2 = tf.where(
          tf.logical_and(x < 0.0, y >= 0.0), atan2 + pi, atan2
      )
      atan2 = tf.where(
          tf.logical_and(x < 0.0, y < 0.0), atan2 - pi, atan2
      )
      atan2 = tf.where(
          tf.logical_and(tf.equal(x, 0.0), y > 0.0), pi, atan2
      )
      atan2 = tf.where(
          tf.logical_and(tf.equal(x, 0.0), y < 0.0), -pi, atan2
      )
      # undefined (return 0)
      atan2 = tf.where(
          tf.logical_and(tf.equal(x, 0.0), tf.equal(y, 0.0)),
          zeros,
          atan2,
      )
      return atan2
  
file_path: kapre/kapre/tflite_compatible_stft.py
imports: import math
  import tensorflow
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: atan2_tflite(y, x, n, dtype) and returns: atan2