parameters: (inputs, f_min, f_max, bit_width, method)
docstring: Interface function to get log threshold.
docstring_summary: Interface function to get log threshold.
docstring_tokens: Interface function to get log threshold .
function: def get_log_th(inputs, f_min, f_max, bit_width, method):
    """Interface function to get log threshold. """
    bit_width = tf.cast(bit_width, dtype=tf.float32, name="bit_width")
    bound = tf.math.pow(2.0, bit_width - 1)
    q_min = tf.math.negative(bound, name="q_min")
    if narrow_range:
      q_min = q_min + 1
    q_max = tf.math.subtract(bound, 1, name="q_max")
  
    with tf.name_scope("GetLogTh"):
      if method == 0:
        return get_log_th_non_overflow(inputs, f_min, f_max, q_min, q_max)
      elif method == 1:
        logger.error('Method 1 not implemented.', NotImplementedError)
      else:
        logger.error('Method {} not implemented.'.format(method),
                     NotImplementedError)
function_tokens: def get_log_th ( inputs , f_min , f_max , bit_width , method ) : bit_width = tf . cast ( bit_width , dtype = tf . float32 , name = "bit_width" ) bound = tf . math . pow ( 2.0 , bit_width - 1 ) q_min = tf . math . negative ( bound , name = "q_min" ) if narrow_range : q_min = q_min + 1 q_max = tf . math . subtract ( bound , 1 , name = "q_max" ) with tf . name_scope ( "GetLogTh" ) : if method == 0 : return get_log_th_non_overflow ( inputs , f_min , f_max , q_min , q_max ) elif method == 1 : logger . error ( 'Method 1 not implemented.' , NotImplementedError ) else : logger . error ( 'Method {} not implemented.' . format ( method ) , NotImplementedError )