code: def test_generic_passthrough_encoder(
      input_size: int, categorical: bool
  ):
      passthrough_encoder = PassthroughEncoder(input_size)
      # Passthrough encoder allows categorical input feature (int), dense encoder's input must be float.
      if categorical:
          inputs = torch.randint(10, (10, input_size))
      else:
          inputs = torch.rand((10, input_size))
      outputs = passthrough_encoder(inputs)
      # Ensures output shape matches encoder expected output shape.
      assert (
          outputs[ENCODER_OUTPUT].shape[1:]
          == passthrough_encoder.output_shape
      )
  
imports: import pytest
  import torch
  from ludwig.constants import ENCODER_OUTPUT
  from ludwig.encoders.generic_encoders import DenseEncoder, PassthroughEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: test_generic_passthrough_encoder(input_size, categorical) without return types