code: def conv2d(
      input_,
      kernel_size,
      stride,
      num_outputs,
      scope,
      activation_fn=tf.nn.relu,
  ):
      """Same-padded convolution with mirror padding instead of zero-padding.
  
      This function expects `kernel_size` to be odd.
  
      Args:
        input_: 4-D Tensor input.
        kernel_size: int (odd-valued) representing the kernel size.
        stride: int representing the strides.
        num_outputs: int. Number of output feature maps.
        scope: str. Scope under which to operate.
        activation_fn: activation function.
  
      Returns:
        4-D Tensor output.
  
      Raises:
        ValueError: if `kernel_size` is even.
      """
      if kernel_size % 2 == 0:
          raise ValueError("kernel_size is expected to be odd.")
      padding = kernel_size // 2
      padded_input = tf.pad(
          input_,
          [[0, 0], [padding, padding], [padding, padding], [0, 0]],
          mode="REFLECT",
      )
      return slim.conv2d(
          padded_input,
          padding="VALID",
          kernel_size=kernel_size,
          stride=stride,
          num_outputs=num_outputs,
          activation_fn=activation_fn,
          scope=scope,
      )
  
imports: from magenta.models.image_stylization import ops
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 2 for calling a global function with example usage: conv2d(input_, kernel_size, stride, num_outputs, scope, activation_fn) and returns: slim