code: def pad(input_tensors, x_only=False):
      input, padding = input_tensors[0], input_tensors[1]
      px, py = padding
      shape = K.shape(input)
      static_shape = input.shape
      if x_only:
          output = tf.image.pad_to_bounding_box(
              input,
              0,
              0,
              (static_shape[1] or K.gather(shape, 1)) + px,
              static_shape[2],
          )
      else:
          output = tf.image.pad_to_bounding_box(
              input,
              0,
              0,
              (static_shape[1] or K.gather(shape, 1)) + px,
              (static_shape[2] or K.gather(shape, 2)) + py,
          )
      return output
  
file_path: calamari/calamari_ocr/ocr/model/graph.py
imports: from functools import partial
  import tensorflow
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import ctc_ops
  from tfaip.model.graphbase import GraphBase
  from calamari_ocr.ocr.model.layers.concat import ConcatLayerParams
  from calamari_ocr.ocr.model.layers.toinputdims import ToInputDimsLayerParams
  from calamari_ocr.ocr.model.layers.transposedconv2d import TransposedConv2DLayerParams
  from calamari_ocr.ocr.model.params import ModelParams
label_desc: Use image node_id 2 for calling a global function with example usage: pad(input_tensors, x_only) and returns: output