code: def test_tflite_shared_pad(
      accel_type,
      op_pairs,
  ):
      np.random.seed(0)
  
      ifm_shape = (1, 55, 32, 3)
      kernel_shape = (3, 3)
      strides = (3, 2)
      dilation = (1, 1)
      activation_function = "RELU"
      op_padding = "SAME"
      sep_padding = (0, 0, 1, 1)
  
      @tf.function
      def tf_function(x):
          def make_depthwise_or_conv2d(pair_idx, x):
              # The input strides to the TensorFlow API needs to be of shape 1x4
              tf_strides = [1, strides[0], strides[1], 1]
              if op_pairs[pair_idx] == "depthwise":
                  weight_shape = [
                      kernel_shape[0],
                      kernel_shape[1],
                      ifm_shape[3],
                      1,
                  ]
                  weight = tf.constant(
                      np.random.uniform(size=weight_shape),
                      dtype=tf.float32,
                  )
                  op = tf.nn.depthwise_conv2d(
                      x,
                      weight,
                      strides=tf_strides,
                      padding=op_padding,
                      dilations=dilation,
                  )
              else:
                  weight_shape = [
                      kernel_shape[0],
                      kernel_shape[1],
                      ifm_shape[3],
                      3,
                  ]
                  weight = tf.constant(
                      np.random.uniform(size=weight_shape),
                      dtype=tf.float32,
                  )
                  op = tf.nn.conv2d(
                      x,
                      weight,
                      strides=tf_strides,
                      padding=op_padding,
                      dilations=dilation,
                  )
              if activation_function == "RELU":
                  op = tf.nn.relu(op)
              return op
  
          x = tf.pad(
              x,
              [
                  [0, 0],
                  [sep_padding[0], sep_padding[2]],
                  [sep_padding[1], sep_padding[3]],
                  [0, 0],
              ],
              "CONSTANT",
          )
  
          x1 = make_depthwise_or_conv2d(0, x)
          x2 = make_depthwise_or_conv2d(1, x)
  
          x3 = tf.math.add(x1, x2)
          return x3
  
      infra.compare_tvm_with_tflite(
          tf_function, [ifm_shape], accel_type
      )
  
imports: import pytest
  import numpy
  import tflite.Model
  import tvm
  import tensorflow
  from tvm import relay
  from tvm.relay.backend.contrib.ethosu import util
  from tvm.relay.op.contrib.ethosu import partition_for_ethosu
  from tvm.testing.aot import generate_ref_data
  from .None import infra
label_desc: Use image node_id 5 for calling a global function with example usage: test_tflite_shared_pad(accel_type, op_pairs) and returns: x3, op