code: def depthwise_conv(
      inputs,
      kernel,
      strides=1,
      padding="valid",
      data_format=None,
      dilation_rate=1,
  ):
      data_format = standardize_data_format(data_format)
      num_spatial_dims = len(inputs.shape) - 2
      if num_spatial_dims > 2:
          raise ValueError(
              "`inputs` rank must be 3 (1D conv) or 4 (2D conv). Received: "
              "{inputs.ndim}."
          )
      # Because we use `tf.nn.depthwise_conv2d` for both 1D and 2D convs, we set
      # `tf_data_format` using 2D conv format.
      tf_data_format = _convert_data_format(data_format, 4)
      padding = padding.upper()
      if isinstance(strides, int):
          strides = (strides,) * num_spatial_dims
      if isinstance(dilation_rate, int):
          dilation_rate = (dilation_rate,) * num_spatial_dims
      if num_spatial_dims == 1:
          # 1D depthwise conv.
          if data_format == "channels_last":
              strides = (1,) + strides * 2 + (1,)
              spatial_start_dim = 1
          else:
              strides = (1, 1) + strides * 2
              spatial_start_dim = 2
          inputs = tf.expand_dims(inputs, spatial_start_dim)
          kernel = tf.expand_dims(kernel, axis=0)
  
          dilation_rate = (
              None if dilation_rate is None else (1,) + dilation_rate
          )
  
          outputs = tf.nn.depthwise_conv2d(
              inputs,
              kernel,
              strides,
              padding,
              data_format=tf_data_format,
              dilations=dilation_rate,
          )
          return tf.squeeze(outputs, [spatial_start_dim])
  
      if data_format == "channels_last":
          strides = (1,) + strides + (1,)
          spatial_start_dim = 1
      else:
          strides = (1, 1) + strides
          spatial_start_dim = 2
      return tf.nn.depthwise_conv2d(
          inputs,
          kernel,
          strides,
          padding,
          data_format=tf_data_format,
          dilations=dilation_rate,
      )
  
imports: import warnings
  import tensorflow
  from keras.backend import standardize_data_format
  from keras.backend import standardize_dtype
  from keras.backend.common.backend_utils import compute_conv_transpose_output_shape
  from keras.backend.config import epsilon
  from keras.backend.tensorflow.core import cast
  from keras.backend.tensorflow.core import convert_to_tensor
label_desc: Use image node_id 23 for calling a global function with example usage: depthwise_conv(inputs, kernel, strides, padding, data_format, dilation_rate) and returns: tf, tf