code: def test_speech_encoder(dense_name, vocab_size):
      quantizer_name = "kmeans"
  
      encoder = SpeechEncoder.by_name(
          dense_model_name=dense_name,
          quantizer_model_name=quantizer_name,
          vocab_size=vocab_size,
          need_f0=False,
          deduplicate=True,
          f0_normalizer=None,
          f0_quantizer=None,
      )
  
      assert encoder is not None
  
      # let's pass 0.5s of silence thru it
      waveform = torch.zeros(encoder.expected_sample_rate // 2)
      encoded = encoder(waveform)
  
      assert encoded
  
file_path: textlesslib/tests/test_model_handling.py
imports: import pytest
  from textless import dispatch_dense_model, dispatch_quantizer
  from textless.data.speech_encoder import SpeechEncoder
  import torch
  from itertools import product
  from textless.vocoders.tacotron2.vocoder import TacotronVocoder
label_desc: Use image node_id 2 for calling a global function with example usage: test_speech_encoder(dense_name, vocab_size) without return types