docstr: spk_emb: Bx1xD
docstr_tok: ["spk_emb",":","Bx1xD"]
code: def get_speaker_embedding(
      self, batch_size, speaker, reference_spec, reference_spec_lens
  ):
      """spk_emb: Bx1xD"""
      if self.speaker_encoder is not None:
          spk_emb = self.speaker_encoder(
              batch_size, speaker, reference_spec, reference_spec_lens
          ).unsqueeze(1)
      elif self.speaker_emb is not None:
          if speaker is None:
              raise ValueError(
                  "Please give speaker id to get lookup speaker embedding."
              )
          spk_emb = self.speaker_emb(speaker).unsqueeze(1)
      else:
          spk_emb = None
  
      return spk_emb
  
imports: import torch
  from nemo.collections.tts.modules.submodules import ConditionalInput, ConditionalLayerNorm
  from nemo.collections.tts.parts.utils.helpers import binarize_attention_parallel, regulate_len
  from nemo.core.classes import NeuralModule, adapter_mixins, typecheck
  from nemo.core.neural_types.elements import EncodedRepresentation, Index, LengthsType, LogprobsType, MelSpectrogramType, ProbsType, RegressionValuesType, TokenDurationType, TokenIndex, TokenLogDurationType
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 4 for calling the FastPitchModule obj's underlying member method code with example usage: obj.get_speaker_embedding(batch_size, speaker, reference_spec, reference_spec_lens) and returns: spk_emb