docstr: Computes the embeddings of a batch of utterance spectrograms.
  :param mels: a batch of mel spectrograms of same duration as a float32 tensor of shape
  (batch_size, n_frames, n_channels)
  :return: the embeddings as a float 32 tensor of shape (batch_size, embedding_size).
  Embeddings are positive and L2-normed, thus they lay in the range [0, 1].
docstr_tok: ["Computes","the","embeddings","of","a","batch","of","utterance","spectrograms",".",":","param","mels",":","a","batch","of","mel","spectrograms","of","same","duration","as","a","float32","tensor","of","shape","(","batch_size",",","n_frames",",","n_channels",")",":","return",":","the","embeddings","as","a","float","32","tensor","of","shape","(","batch_size",",","embedding_size",")",".","Embeddings","are","positive","and","L2-normed",",","thus","they","lay","in","the","range","[","0",",","1","]","."]
code: def forward(self, mels: torch.FloatTensor):
      """
      Computes the embeddings of a batch of utterance spectrograms.
      :param mels: a batch of mel spectrograms of same duration as a float32 tensor of shape
      (batch_size, n_frames, n_channels)
      :return: the embeddings as a float 32 tensor of shape (batch_size, embedding_size).
      Embeddings are positive and L2-normed, thus they lay in the range [0, 1].
      """
      # Pass the input through the LSTM layers and retrieve the final hidden state of the last
      # layer. Apply a cutoff to 0 for negative values and L2 normalize the embeddings.
      _, (hidden, _) = self.lstm(mels)
      embeds_raw = self.relu(self.linear(hidden[-1]))
      return embeds_raw / torch.norm(embeds_raw, dim=1, keepdim=True)
  
file_path: TTS/TTS/vc/modules/freevc/speaker_encoder/speaker_encoder.py
imports: from pathlib import Path
  from time import perf_counter
  from typing import List, Union
  import numpy
  import torch
  from torch import nn
  from TTS.utils.io import load_fsspec
  from TTS.vc.modules.freevc.speaker_encoder import audio
  from TTS.vc.modules.freevc.speaker_encoder.hparams import *
label_desc: Use image node_id 2 for calling the SpeakerEncoder obj's underlying member method code with example usage: obj.forward(mels) and returns: unknown