code: def test_conv1d_layer(
      kernel_size: int,
      strides: int,
      padding: str,
      dilation: int,
      pool_size: Union[None, int],
      pool_padding: str,
      pool_stride: int,
      pool_function: str,
  ) -> None:
      # make test repeatable
      torch.manual_seed(RANDOM_SEED)
  
      # setup synthetic tensor for test
      input = torch.randn(
          [BATCH_SIZE, SEQ_SIZE, HIDDEN_SIZE], dtype=torch.float32
      )
  
      conv1_layer = Conv1DLayer(
          in_channels=HIDDEN_SIZE,
          out_channels=NUM_FILTERS,
          max_sequence_length=SEQ_SIZE,
          kernel_size=kernel_size,
          strides=strides,
          padding=padding,
          dilation=dilation,
          pool_function=pool_function,
          pool_size=pool_size,
          pool_strides=pool_stride,
          pool_padding=pool_padding,
      )
  
      out_tensor = conv1_layer(input)
  
      # check for correct output class
      assert isinstance(out_tensor, torch.Tensor)
  
      # check for correct output shape
      output_seq_size = expected_seq_size(
          seq_size=SEQ_SIZE,
          padding=padding,
          kernel_size=kernel_size,
          stride=strides,
          dilation=dilation,
          pool_size=pool_size,
          pool_padding=pool_padding,
          pool_stride=pool_stride,
      )
      assert out_tensor.size() == (
          BATCH_SIZE,
          output_seq_size,
          NUM_FILTERS,
      )
  
file_path: ludwig/tests/ludwig/modules/test_convolutional_modules.py
imports: from typing import Callable, Dict, List, Optional, Tuple, Union
  import pytest
  import torch
  from ludwig.modules.convolutional_modules import Conv1DLayer, Conv1DStack, Conv2DLayer, Conv2DLayerFixedPadding, Conv2DStack, ParallelConv1D, ParallelConv1DStack, ResNet, ResNetBlock, ResNetBlockLayer, ResNetBottleneckBlock
  from ludwig.utils.image_utils import get_img_output_shape
  from tests.integration_tests.parameter_update_utils import check_module_parameters_updated
label_desc: Use image node_id 2 for calling a global function with example usage: test_conv1d_layer(kernel_size, strides, padding, dilation, pool_size, pool_padding, pool_stride, pool_function) without return types