code: def conv1d(
      x: np.ndarray,
      filters: np.ndarray,
      strides: Union[int, Tuple[int]],
      padding: Union[str, int, Sequence[Tuple[int, int]]],
      /,
      *,
      data_format: str = "NWC",
      filter_format: str = "channel_last",
      x_dilations: Union[int, Tuple[int]] = 1,
      dilations: Union[int, Tuple[int]] = 1,
      bias: Optional[np.ndarray] = None,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      strides = [strides] if isinstance(strides, int) else strides
      dilations = (
          [dilations] if isinstance(dilations, int) else dilations
      )
      if data_format == "NCW":
          x = np.transpose(x, (0, 2, 1))
      x, filters = _ff_xd_before_conv(
          x, filters, 1, filter_format, x_dilations
      )
      x, filters = _dilate_pad_conv(
          x, filters, strides, padding, 1, dilations
      )
  
      x_shape = x.shape
      filter_shape = list(filters.shape[0:1])
      input_dim = filters.shape[-2]
      output_dim = filters.shape[-1]
      new_w = (x_shape[1] - filter_shape[0]) // strides[0] + 1
      new_shape = [x_shape[0], new_w] + filter_shape + [x_shape[-1]]
      new_strides = (
          x.strides[0],
          x.strides[1] * strides[0],
          x.strides[1],
          x.strides[2],
      )
      # B x OW x KW x I
      sub_matrices = np.lib.stride_tricks.as_strided(
          x, new_shape, new_strides, writeable=False
      )
      # B x OW x KW x I x O
      sub_matrices_w_output_dim = np.tile(
          np.expand_dims(sub_matrices, -1), [1] * 4 + [output_dim]
      )
      # B x OW x KW x I x O
      mult = sub_matrices_w_output_dim * filters.reshape(
          [1] * 2 + filter_shape + [input_dim, output_dim]
      )
      # B x OW x O
      res = np.sum(mult, (2, 3))
      res = np.add(res, bias) if bias is not None else res
      if data_format == "NCW":
          res = np.transpose(res, (0, 2, 1))
      return res
  
file_path: ivy/ivy/functional/backends/numpy/layers.py
imports: import numpy
  from typing import Union, Tuple, Optional, Sequence
  import ivy
  from ivy.functional.ivy.layers import _handle_padding, _deconv_length, _get_x_data_format
label_desc: Use image node_id 5 for calling a global function with example usage: conv1d() and returns: res