code: def spectrogram(input, nfft, window, stride, name=None):
      """
      Create spectrogram from audio.
  
      Args:
        input: An 1-D audio signal Tensor.
        nfft: Size of FFT.
        window: Size of window.
        stride: Size of hops between windows.
        name: A name for the operation (optional).
  
      Returns:
        A tensor of spectrogram.
      """
  
      # TODO: Support audio with channel > 1.
      return tf.math.abs(
          tf.signal.stft(
              input,
              frame_length=window,
              frame_step=stride,
              fft_length=nfft,
              window_fn=tf.signal.hann_window,
              pad_end=True,
          )
      )
  
imports: import sys
  import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 1 for calling a global function with example usage: spectrogram(input, nfft, window, stride, name) and returns: tf