code: def test_attentive_transformer(
      entmax_mode: Optional[str],
      input_size: int,
      size: int,
      output_size: int,
      virtual_batch_size: Optional[int],
      batch_size: int,
  ) -> None:
      # setup synthetic tensors
      torch.manual_seed(RANDOM_SEED)
      input_tensor = torch.randn(
          [batch_size, input_size], dtype=torch.float32
      )
      prior_scales = torch.ones([batch_size, input_size])
  
      # setup required transformers for test
      feature_transformer = FeatureTransformer(
          input_size,
          size + output_size,
          bn_virtual_bs=virtual_batch_size,
      )
      attentive_transformer = AttentiveTransformer(
          size,
          input_size,
          bn_virtual_bs=virtual_batch_size,
          entmax_mode=entmax_mode,
      )
  
      # process synthetic tensor through transformers
      x = feature_transformer(input_tensor)
      output_tensor = attentive_transformer(
          x[:, output_size:], prior_scales
      )
  
      # check for expected shape and properties
      assert isinstance(output_tensor, torch.Tensor)
      assert output_tensor.shape == (batch_size, input_size)
  
      assert attentive_transformer.input_shape[-1] == size
      assert attentive_transformer.output_shape[-1] == input_size
      assert attentive_transformer.input_dtype == torch.float32
      if entmax_mode == "adaptive":
          assert isinstance(
              attentive_transformer.trainable_alpha, torch.Tensor
          )
  
file_path: ludwig/tests/ludwig/modules/test_tabnet_modules.py
imports: from typing import Optional
  import pytest
  import torch
  from ludwig.modules.tabnet_modules import AttentiveTransformer, FeatureBlock, FeatureTransformer, TabNet
  from ludwig.utils.entmax import sparsemax
  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_attentive_transformer(entmax_mode, input_size, size, output_size, virtual_batch_size, batch_size) without return types