code: def test_parallel_conv1d(layers: Union[None, list]) -> None:
      input = torch.randn(
          [BATCH_SIZE, SEQ_SIZE, HIDDEN_SIZE], dtype=torch.float32
      )
  
      parallel_conv1d = ParallelConv1D(
          in_channels=HIDDEN_SIZE,
          out_channels=NUM_FILTERS,
          max_sequence_length=SEQ_SIZE,
          layers=layers,
          default_num_filters=NUM_FILTERS,
      )
  
      # check for correct stack formation
      if layers is None:
          assert len(parallel_conv1d.parallel_layers) == 4
      else:
          # custom layer specification
          assert len(parallel_conv1d.parallel_layers) == len(layers)
          assert parallel_conv1d.parallel_layers[0].kernel_size == 3
          assert parallel_conv1d.parallel_layers[1].kernel_size == 4
  
      # generate output tensor
      out_tensor = parallel_conv1d(input)
  
      # check for correct output class
      assert isinstance(out_tensor, torch.Tensor)
  
      # check for correct output shape
      parallel_module = parallel_conv1d.parallel_layers[0]
      output_seq_size = expected_seq_size(
          seq_size=parallel_module.input_shape[0],
          padding=parallel_module.padding,
          kernel_size=parallel_module.kernel_size,
          stride=parallel_module.stride,
          dilation=parallel_module.dilation,
          pool_size=parallel_module.pool_size,
          pool_padding=parallel_module.pool_padding,
          pool_stride=parallel_module.pool_strides,
      )
  
      assert out_tensor.size() == (
          BATCH_SIZE,
          output_seq_size,
          len(parallel_conv1d.parallel_layers) * 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 4 for calling a global function with example usage: test_parallel_conv1d(layers) without return types