code: def avg_pool1d(
      x: Union[tf.Tensor, tf.Variable],
      kernel: Union[int, Tuple[int]],
      strides: Union[int, Tuple[int]],
      padding: Union[str, int, List[Tuple[int, int]]],
      /,
      *,
      data_format: str = "NWC",
      count_include_pad: bool = False,
      ceil_mode: bool = False,
      divisor_override: Optional[int] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      if isinstance(kernel, int):
          kernel = [kernel]
      elif len(kernel) == 1:
          kernel = [kernel[0]]
  
      if isinstance(strides, int):
          strides = [strides]
      elif len(strides) == 1:
          strides = [strides[0]]
  
      if data_format in ("NCW", "NCL"):
          print("why")
          x = tf.transpose(x, (0, 2, 1))
  
      manual_padding = False
      # Have to manually pad if explicit padding is provided, or if ceil_mode is True
      if not isinstance(padding, str) or ceil_mode or count_include_pad:
          padding, pad_specific, c = _handle_manual_pad_avg_pool(
              x, kernel, strides, padding, ceil_mode, 1
          )
          x = tf.pad(x, [(0, 0), *padding, (0, 0)], constant_values=0)
          manual_padding = True
          padding = "VALID"
  
      res = tf.nn.avg_pool1d(x, kernel, strides, padding)
  
      # removing any manual padding added because of ceil_mode or count_include_pad
      if (manual_padding and not count_include_pad) or ceil_mode:
          if not count_include_pad:
              num_padded_values = tf.convert_to_tensor(
                  ivy.map(
                      _get_num_padded_values,
                      constant={
                          "p": pad_specific[0],
                          "n": x.shape[1] - pad_specific[0],
                          "k": kernel[0],
                          "s": strides[0],
                      },
                      unique={
                          "i": tf.range(res.shape[1]),
                      },
                  ),
                  dtype=res.dtype,
              )
          else:
              num_padded_values = tf.scatter_nd(
                  tf.constant([[res.shape[1] - 1]]),
                  tf.constant([c[0]], dtype=res.dtype),
                  tf.constant([res.shape[1]], dtype=tf.int32),
              )
          res = (kernel[0] * res) / (
              kernel[0] - num_padded_values[:, None]
          )
  
      if data_format in ("NCW", "NCL"):
          res = tf.transpose(res, (0, 2, 1))
      return res
  
imports: import math
  from typing import Union, Optional, Tuple, List, Literal, Sequence, Callable
  import tensorflow
  from ivy.func_wrapper import inputs_to_ivy_arrays, output_to_native_arrays, with_unsupported_dtypes, with_supported_dtypes, with_supported_device_and_dtypes
  from ..None import backend_version
  import ivy
  from ivy.functional.ivy.layers import _handle_padding, _get_num_padded_values, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode, _get_size
label_desc: Use image node_id 6 for calling a global function with example usage: avg_pool1d() and returns: res