code: def unfold(inp, kernel_width, padding="causal"):
      if padding.lower() == "causal":
          padding_l = kernel_width - 1
      elif padding.lower() == "same":
          padding_l = kernel_width // 2
  
      slices = []
      paddings = [
          [0, 0],
          [padding_l, kernel_width - padding_l - 1],
          [0, 0],
      ]
      padded_input = tf.pad(inp, paddings, "CONSTANT")
      leng = tf.shape(padded_input)[1]
      for i in range(kernel_width):
          slices.append(padded_input[:, i : leng - kernel_size + i + 1])
      return tf.stack(slices, 2)
  
file_path: finetune/finetune/custom_ops/indico_tf_ops/python/dynamic_conv.py
imports: import os
  import math
  import numpy
  import tensorflow
  from finetune.util.shapes import shape_list
  from finetune.custom_ops.indico_tf_ops.python import indico_ops
label_desc: Use image node_id 2 for calling a global function with example usage: unfold(inp, kernel_width, padding) and returns: tf