code: def conv_general_dilated(
      x: np.ndarray,
      filters: np.ndarray,
      strides: Union[
          int, Tuple[int], Tuple[int, int], Tuple[int, int, int]
      ],
      padding: Union[str, int, Sequence[Tuple[int, int]]],
      /,
      *,
      dims: int = 2,
      data_format: str = "channel_last",
      filter_format: str = "channel_last",
      feature_group_count: int = 1,
      x_dilations: Union[
          int, Tuple[int], Tuple[int, int], Tuple[int, int, int]
      ] = 1,
      dilations: Union[
          int, Tuple[int], Tuple[int, int], Tuple[int, int, int]
      ] = 1,
      bias: Optional[np.ndarray] = None,
      out: np.ndarray = None,
  ) -> np.ndarray:
      # permuting dims based on formats
      if data_format == "channel_first":
          x = np.transpose(x, (0, *range(2, dims + 2), 1))
      if filter_format == "channel_first":
          filters = np.transpose(filters, (*range(2, dims + 2), 1, 0))
  
      strides = (
          [strides] * dims if isinstance(strides, int) else strides
      )
      dilations = (
          [dilations] * dims
          if isinstance(dilations, int)
          else dilations
      )
      x_dilations = (
          [x_dilations] * dims
          if isinstance(x_dilations, int)
          else x_dilations
      )
  
      for j in range(dims):
          if x_dilations[j] > 1:
              x = _add_dilations(x, x_dilations[j], axis=j + 1)
      x, filters = _dilate_pad_conv(
          x, filters, strides, padding, dims, dilations
      )
  
      x_shape = x.shape
      filter_shape = list(filters.shape[0:dims])
      input_dim = filters.shape[-2]
      output_dim = filters.shape[-1]
      new_shape = [
          (x_shape[i + 1] - filter_shape[i]) // strides[i] + 1
          for i in range(dims)
      ]
      res = []
      new_shape = [x_shape[0], *new_shape] + filter_shape + [input_dim]
      for i, j in zip(
          range(0, x.shape[-1], input_dim),
          range(0, output_dim, output_dim // feature_group_count),
      ):
          sliced_x = x[..., i : i + input_dim]
          sliced_filters = filters[
              ..., j : j + output_dim // feature_group_count
          ]
          normal_strides = [
              sliced_x.strides[i] for i in range(1, dims + 2)
          ]
          changed_strides = [
              sliced_x.strides[i] * strides[i - 1]
              for i in range(1, dims + 1)
          ]
          new_strides = (
              x.strides[0],
              *changed_strides,
              *normal_strides,
          )
          # B x OH x OW x KH x KW x I
          sub_matrices = np.lib.stride_tricks.as_strided(
              sliced_x, new_shape, new_strides, writeable=False
          )
  
          # B x OH x OW x KH x KW x I x O
          sub_matrices_w_output_dim = np.tile(
              np.expand_dims(sub_matrices, -1),
              [1] * (dims * 2 + 2)
              + [output_dim // feature_group_count],
          )
          # B x OH x OW x KH x KW x I x O
          mult = sub_matrices_w_output_dim * sliced_filters.reshape(
              [1] * (dims + 1)
              + filter_shape
              + [input_dim, output_dim // feature_group_count]
          )
  
          # B x OH x OW x O
          res.append(
              np.sum(
                  mult,
                  tuple([i for i in range(dims + 1, dims * 2 + 2)]),
              )
          )
      res = np.concatenate(res, axis=-1)
      res = np.add(res, bias) if bias is not None else res
  
      if data_format == "channel_first":
          return np.transpose(res, (0, dims + 1, *range(1, dims + 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 12 for calling a global function with example usage: conv_general_dilated() and returns: res, np