code: def conv2d_layer(
      inputs,
      filters,
      kernel_size,
      strides=(1, 1),
      padding="valid",
      data_format="channels_last",
      dilation_rate=(1, 1),
  ):
      dtype = inputs.dtype
      c_axis = -1 if data_format == "channels_last" else 1
      nchan = inputs.shape[c_axis]
      weights_shape = (kernel_size[0], kernel_size[1], nchan, filters)
      weights = constant_op.constant(
          np.random.randn(*weights_shape), dtype=dtype
      )
      padding = padding.upper()
      if data_format == "channels_last":
          strides = [1] + list(strides) + [1]
          dilations = [1] + list(dilation_rate) + [1]
          data_format = "NHWC"
      else:
          strides = [1, 1] + list(strides)
          dilations = [1, 1] + list(dilation_rate)
          data_format = "NCHW"
      return gen_nn_ops.conv2d(
          inputs,
          weights,
          strides=strides,
          padding=padding,
          dilations=dilations,
          data_format=data_format,
      )
  
imports: import numpy
  from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: conv2d_layer(inputs, filters, kernel_size, strides, padding, data_format, dilation_rate) and returns: gen_nn_ops