code: def test_single_channel_spk_model(
      frontend, encoder, pooling, projector, training
  ):
      inputs = torch.randn(2, 8000)
      ilens = torch.LongTensor([8000, 7800])
      spk_labels = torch.randint(0, 10, (2,))
      spk_model = ESPnetSpeakerModel(
          frontend=frontend,
          specaug=None,
          normalize=None,
          encoder=encoder,
          pooling=pooling,
          projector=projector,
          loss=aamsoftmax_loss,
      )
  
      if training:
          spk_model.train()
      else:
          spk_model.eval()
  
      kwargs = {
          "speech": inputs,
          "speech_lengths": ilens,
          "spk_labels": spk_labels,
      }
      loss, stats, weight = spk_model(**kwargs)
  
      if training:
          loss.backward()
  
file_path: espnet/test/espnet2/spk/test_espnet_spk_model.py
imports: import pytest
  import torch
  from espnet2.asr.frontend.asteroid_frontend import AsteroidFrontend
  from espnet2.asr.frontend.melspec_torch import MelSpectrogramTorch
  from espnet2.asr.specaug.specaug import SpecAug
  from espnet2.layers.utterance_mvn import UtteranceMVN
  from espnet2.spk.encoder.ecapa_tdnn_encoder import EcapaTdnnEncoder
  from espnet2.spk.encoder.rawnet3_encoder import RawNet3Encoder
  from espnet2.spk.espnet_model import ESPnetSpeakerModel
  from espnet2.spk.loss.aamsoftmax import AAMSoftmax
  from espnet2.spk.loss.aamsoftmax_subcenter_intertopk import ArcMarginProduct_intertopk_subcenter
  from espnet2.spk.pooling.chn_attn_stat_pooling import ChnAttnStatPooling
  from espnet2.spk.projector.rawnet3_projector import RawNet3Projector
label_desc: Use image node_id 1 for calling a global function with example usage: test_single_channel_spk_model(frontend, encoder, pooling, projector, training) without return types