docstr: Forward pass of the model.
  
  Args:
      x (Tensor): Raw waveform signal or spectrogram frames. If input is a waveform, `torch_spec` must be `True`
          to compute the spectrogram on-the-fly.
      l2_norm (bool): Whether to L2-normalize the outputs.
  
  Shapes:
      - x: :math:`(N, 1, T_{in})` or :math:`(N, D_{spec}, T_{in})`
docstr_tok: ["Forward","pass","of","the","model",".","Args",":","x","(","Tensor",")",":","Raw","waveform","signal","or","spectrogram","frames",".","If","input","is","a","waveform",",","`","torch_spec","`","must","be","`","True","`","to","compute","the","spectrogram","on-the-fly",".","l2_norm","(","bool",")",":","Whether","to","L2-normalize","the","outputs",".","Shapes",":","-","x",":",":","math",":","`","(","N",",","1",",","T_","{","in","}",")","`","or",":","math",":","`","(","N",",","D_","{","spec","}",",","T_","{","in","}",")","`"]
code: def forward(self, x, l2_norm=True):
      """Forward pass of the model.
  
      Args:
          x (Tensor): Raw waveform signal or spectrogram frames. If input is a waveform, `torch_spec` must be `True`
              to compute the spectrogram on-the-fly.
          l2_norm (bool): Whether to L2-normalize the outputs.
  
      Shapes:
          - x: :math:`(N, 1, T_{in})` or :math:`(N, D_{spec}, T_{in})`
      """
      with torch.no_grad():
          with torch.cuda.amp.autocast(enabled=False):
              if self.use_torch_spec:
                  x.squeeze_(1)
                  x = self.torch_spec(x)
              x = self.instancenorm(x).transpose(1, 2)
      d = self.layers(x)
      if self.use_lstm_with_projection:
          d = d[:, -1]
      if l2_norm:
          d = torch.nn.functional.normalize(d, p=2, dim=1)
      return d
  
file_path: TTS/TTS/encoder/models/lstm.py
imports: import torch
  from torch import nn
  from TTS.encoder.models.base_encoder import BaseEncoder
label_desc: Use image node_id 3 for calling the LSTMSpeakerEncoder obj's underlying member method code with example usage: obj.forward(x, l2_norm) and returns: d