code: def inference(
      self, inputs, obs_labels=None, lat=None, ret_has_eos=False
  ):
      embedded_inputs = self.embedding(inputs).transpose(1, 2)
      encoder_outputs = self.encoder.inference(embedded_inputs)
  
      if obs_labels is None:
          obs_labels = torch.LongTensor(len(inputs))
          obs_labels = obs_labels.to(inputs.device).zero_()
  
      obs = None
      if self.obs_embedding is not None:
          obs = self.obs_embedding(obs_labels)
  
      if self.lat_encoder is not None:
          if lat is None:
              lat = torch.FloatTensor(
                  len(inputs), self.lat_encoder.lat_dim
              )
              lat = (
                  lat.to(inputs.device)
                  .zero_()
                  .type(encoder_outputs.type())
              )
  
      obs_and_lat = [x for x in [obs, lat] if x is not None]
      if bool(obs_and_lat):
          obs_and_lat = torch.cat(obs_and_lat, dim=-1)
      else:
          obs_and_lat = None
  
      (
          mel_outputs,
          gate_outputs,
          alignments,
          has_eos,
      ) = self.decoder.inference(
          encoder_outputs, obs_and_lat, ret_has_eos=True
      )
  
      mel_outputs_postnet = self.postnet(mel_outputs)
      mel_outputs_postnet = mel_outputs + mel_outputs_postnet
  
      outputs = self.parse_output(
          [mel_outputs, mel_outputs_postnet, gate_outputs, alignments]
      )
  
      if ret_has_eos:
          return outputs + [has_eos]
      else:
          return outputs
  
imports: from math import sqrt
  import torch
  import torch.distributions
  from torch.autograd import Variable
  from torch import nn
  from torch.nn import functional
  from .layers import ConvNorm, LinearNorm, GlobalAvgPool
  from .utils import to_gpu, get_mask_from_lengths
label_desc: Use image node_id 5 for calling the Tacotron2 obj's underlying member method code with example usage: obj.inference(inputs, obs_labels, lat, ret_has_eos) and returns: unknown, outputs