code: def test_embed_weighted(
      vocab: List[str],
      embedding_size: int,
      representation: str,
  ):
      embed_weighted = EmbedWeighted(
          vocab=vocab,
          embedding_size=embedding_size,
          representation=representation,
      ).to(DEVICE)
      inputs = (
          torch.randint(0, 2, size=(2, len(vocab))).bool().to(DEVICE)
      )
      outputs = embed_weighted(inputs)
      assert outputs.shape[1:] == embed_weighted.output_shape
  
file_path: ludwig/tests/ludwig/modules/test_embedding_modules.py
imports: from typing import List
  import pytest
  import torch
  from ludwig.modules.embedding_modules import Embed, EmbedSequence, EmbedSet, EmbedWeighted, TokenAndPositionEmbedding
  from ludwig.utils.torch_utils import get_torch_device
label_desc: Use image node_id 3 for calling a global function with example usage: test_embed_weighted(vocab, embedding_size, representation) without return types