code: def _composite_mirror_pad(input_, paddings, mode):
      shape = input_.shape.as_list()
      for i in range(len(shape)):
          rdims = tf.raw_ops.OneHot(
              indices=i,
              depth=len(shape),
              on_value=True,
              off_value=False,
              axis=-1,
          )
          rarray = tf.raw_ops.Reverse(tensor=input_, dims=rdims)
  
          left_padding_size = tf.raw_ops.GatherNd(
              params=paddings, indices=[i, 0]
          )
          right_padding_size = tf.raw_ops.GatherNd(
              params=paddings, indices=[i, 1]
          )
  
          if mode == "REFLECT":
              left_padding, _ = tf.raw_ops.SplitV(
                  value=rarray,
                  size_splits=[left_padding_size, -1],
                  axis=i,
                  num_split=2,
              )
              _, right_padding = tf.raw_ops.SplitV(
                  value=rarray,
                  size_splits=[-1, right_padding_size],
                  axis=i,
                  num_split=2,
              )
          else:
              _, left_padding = tf.raw_ops.SplitV(
                  value=rarray,
                  size_splits=[-1, left_padding_size],
                  axis=i,
                  num_split=2,
              )
              right_padding, _ = tf.raw_ops.SplitV(
                  value=rarray,
                  size_splits=[right_padding_size, -1],
                  axis=i,
                  num_split=2,
              )
  
          input_ = tf.raw_ops.Concat(
              concat_dim=i, values=[left_padding, input_, right_padding]
          )
      return input_
  
file_path: tensorflow/tensorflow/compiler/mlir/tfr/examples/pad/ops_defs.py
imports: import os
  import sys
  from absl import app
  import tensorflow
  from tensorflow.compiler.mlir.tfr.python import composite
  from tensorflow.compiler.mlir.tfr.python.op_reg_gen import gen_register_op
  from tensorflow.compiler.mlir.tfr.python.tfr_gen import tfr_gen_from_module
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.platform import flags
label_desc: Use image node_id 1 for calling a global function with example usage: _composite_mirror_pad(input_, paddings, mode) and returns: input_