code: def smooth(x, filter_size=3):
      """Smooth 1-d signal with a box filter."""
      x = tf.convert_to_tensor(x, tf.float32)
      is_2d = len(x.shape) == 2
      x = x[:, :, tf.newaxis] if is_2d else x[tf.newaxis, :, tf.newaxis]
      w = tf.ones([filter_size])[:, tf.newaxis, tf.newaxis] / float(
          filter_size
      )
      y = tf.nn.conv1d(x, w, stride=1, padding="SAME")
      y = y[:, :, 0] if is_2d else y[0, :, 0]
      return y.numpy()
  
file_path: ddsp/ddsp/training/postprocessing.py
imports: from ddsp import spectral_ops
  from ddsp.core import hz_to_midi
  import numpy
  from scipy import stats
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling a global function with example usage: smooth(x, filter_size) and returns: y