code: def pad(input, ksize, mode, constant_values):
      input = tf.convert_to_tensor(input)
      ksize = tf.convert_to_tensor(ksize)
      mode = "CONSTANT" if mode is None else str.upper(mode)
      constant_values = (
          tf.zeros([], dtype=input.dtype)
          if constant_values is None
          else tf.convert_to_tensor(constant_values, dtype=input.dtype)
      )
  
      assert mode in ("CONSTANT", "REFLECT", "SYMMETRIC")
  
      height, width = ksize[0], ksize[1]
      top = (height - 1) // 2
      bottom = height - 1 - top
      left = (width - 1) // 2
      right = width - 1 - left
      paddings = [[0, 0], [top, bottom], [left, right], [0, 0]]
      return tf.pad(
          input, paddings, mode=mode, constant_values=constant_values
      )
  
file_path: io/tensorflow_io/python/experimental/filter_ops.py
imports: import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: pad(input, ksize, mode, constant_values) and returns: tf