parameters: (input, axis, epsilon, name=None)
return_statement: return tf.stack([start, stop], axis=axis)
docstring: Trim the noise from beginning and end of the audio.
  
      Args:
        input: An audio Tensor.
        axis: The axis to trim.
        epsilon: The max value to be considered as noise.
        name: A name for the operation (optional).
      Returns:
        A tensor of start and stop with shape `[..., 2, ...]`.
docstring_summary: Trim the noise from beginning and end of the audio.
docstring_tokens: Trim the noise from beginning and end of the audio .
function: def trim(input, axis, epsilon, name=None):
      """
      Trim the noise from beginning and end of the audio.
  
      Args:
        input: An audio Tensor.
        axis: The axis to trim.
        epsilon: The max value to be considered as noise.
        name: A name for the operation (optional).
      Returns:
        A tensor of start and stop with shape `[..., 2, ...]`.
      """
      shape = tf.shape(input, out_type=tf.int64)
      length = shape[axis]
  
      nonzero = tf.math.greater(input, epsilon)
      check = tf.reduce_any(nonzero, axis=axis)
  
      forward = tf.cast(nonzero, tf.int8)
      reverse = tf.reverse(forward, [axis])
  
      start = tf.where(check, tf.argmax(forward, axis=axis), length)
      stop = tf.where(check, tf.argmax(reverse, axis=axis), tf.constant(0, tf.int64))
      stop = length - stop
  
      return tf.stack([start, stop], axis=axis)
function_tokens: def trim ( input , axis , epsilon , name = None ) : shape = tf . shape ( input , out_type = tf . int64 ) length = shape [ axis ] nonzero = tf . math . greater ( input , epsilon ) check = tf . reduce_any ( nonzero , axis = axis ) forward = tf . cast ( nonzero , tf . int8 ) reverse = tf . reverse ( forward , [ axis ] ) start = tf . where ( check , tf . argmax ( forward , axis = axis ) , length ) stop = tf . where ( check , tf . argmax ( reverse , axis = axis ) , tf . constant ( 0 , tf . int64 ) ) stop = length - stop return tf . stack ( [ start , stop ] , axis = axis )