code: def get_logits(
      self,
      speech_conditioning_inputs,
      first_inputs,
      first_head,
      second_inputs=None,
      second_head=None,
      get_attns=False,
      return_latent=False,
  ):
      if second_inputs is not None:
          emb = torch.cat(
              [speech_conditioning_inputs, first_inputs, second_inputs],
              dim=1,
          )
      else:
          emb = torch.cat(
              [speech_conditioning_inputs, first_inputs], dim=1
          )
  
      gpt_out = self.gpt(
          inputs_embeds=emb,
          return_dict=True,
          output_attentions=get_attns,
      )
      if get_attns:
          return gpt_out.attentions
  
      enc = gpt_out.last_hidden_state[
          :, 1:
      ]  # The first logit is tied to the speech_conditioning_input
      enc = self.final_norm(enc)
  
      if return_latent:
          return (
              enc[
                  :,
                  speech_conditioning_inputs.shape[
                      1
                  ] : speech_conditioning_inputs.shape[1]
                  + first_inputs.shape[1],
              ],
              enc[:, -second_inputs.shape[1] :],
          )
  
      first_logits = enc[:, : first_inputs.shape[1]]
      first_logits = first_head(first_logits)
      first_logits = first_logits.permute(0, 2, 1)
      if second_inputs is not None:
          second_logits = enc[:, -second_inputs.shape[1] :]
          second_logits = second_head(second_logits)
          second_logits = second_logits.permute(0, 2, 1)
          return first_logits, second_logits
      else:
          return first_logits
  
imports: import functools
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList
  from transformers.modeling_outputs import CausalLMOutputWithCrossAttentions
  from TTS.tts.layers.tortoise.arch_utils import AttentionBlock, TypicalLogitsWarper
label_desc: Use image node_id 5 for calling the UnifiedVoice obj's underlying member method code with example usage: obj.get_logits(speech_conditioning_inputs, first_inputs, first_head, second_inputs, second_head, get_attns, return_latent) and returns: gpt_out, enc,  enc, first_logits,  second_logits, first_logits