code: def test_binary_input_feature(binary_config: Dict, encoder: str):
      binary_config.update({ENCODER: {"type": encoder}})
      binary_config, _ = load_config_with_kwargs(
          BinaryInputFeatureConfig, binary_config
      )
      binary_input_feature = BinaryInputFeature(binary_config).to(
          DEVICE
      )
  
      binary_tensor = binary_input_feature.create_sample_input(
          batch_size=BATCH_SIZE
      )
      assert binary_tensor.shape == torch.Size([BATCH_SIZE])
      assert binary_tensor.dtype == torch.bool
  
      encoder_output = binary_input_feature(binary_tensor)
  
      assert (
          encoder_output[ENCODER_OUTPUT].shape[1:]
          == binary_input_feature.output_shape
      )
  
file_path: ludwig/tests/ludwig/features/test_binary_feature.py
imports: from typing import Dict
  import pytest
  import torch
  from ludwig.constants import ENCODER, ENCODER_OUTPUT
  from ludwig.features.binary_feature import BinaryInputFeature, BinaryOutputFeature
  from ludwig.schema.features.binary_feature import BinaryInputFeatureConfig, BinaryOutputFeatureConfig
  from ludwig.schema.utils import load_config_with_kwargs
  from ludwig.utils.torch_utils import get_torch_device
label_desc: Use image node_id 2 for calling a global function with example usage: test_binary_input_feature(binary_config, encoder) without return types