docstr: cond_input: (b, 80, s) or (b, 1, 80, s)
  conds: (b, 1024, s)
docstr_tok: ["cond_input",":","(","b",",","80",",","s",")","or","(","b",",","1",",","80",",","s",")","conds",":","(","b",",","1024",",","s",")"]
code: def get_style_emb(self, cond_input, return_latent=False):
      """
      cond_input: (b, 80, s) or (b, 1, 80, s)
      conds: (b, 1024, s)
      """
      conds = None
      if not return_latent:
          if cond_input.ndim == 4:
              cond_input = cond_input.squeeze(1)
          conds = self.conditioning_encoder(cond_input)  # (b, d, s)
          if self.use_perceiver_resampler:
              conds = self.conditioning_perceiver(
                  conds.permute(0, 2, 1)
              ).transpose(
                  1, 2
              )  # (b, d, 32)
      else:
          # already computed
          conds = cond_input.unsqueeze(1)
      return conds
  
imports: import functools
  import math
  import random
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers import GPT2Config
  from TTS.tts.layers.xtts.gpt_inference import GPT2InferenceModel
  from TTS.tts.layers.xtts.latent_encoder import ConditioningEncoder
  from TTS.tts.layers.xtts.perceiver_encoder import PerceiverResampler
label_desc: Use image node_id 9 for calling the GPT obj's underlying member method code with example usage: obj.get_style_emb(cond_input, return_latent) and returns: conds