class_docstr: Transition Model of the HMM, it represents the probability of transitioning
  form current state to all other states
class_docstr_tok: ["Transition","Model","of","the","HMM",",","it","represents","the","probability","of","transitioning","form","current","state","to","all","other","states"]
docstr: product of the past state with transitional probabilities in log space
  
  Args:
      log_alpha_scaled (torch.Tensor): Multiply previous timestep's alphas by
                  transition matrix (in log domain)
          - shape: (batch size, N)
      transition_vector (torch.tensor): transition vector for each state
          - shape: (N)
      inputs_len (int tensor): Lengths of states in a batch
          - shape: (batch)
  
  Returns:
      out (torch.FloatTensor): log probability of transitioning to each state
docstr_tok: ["product","of","the","past","state","with","transitional","probabilities","in","log","space","Args",":","log_alpha_scaled","(","torch.Tensor",")",":","Multiply","previous","timestep","'s","alphas","by","transition","matrix","(","in","log","domain",")","-","shape",":","(","batch","size",",","N",")","transition_vector","(","torch.tensor",")",":","transition","vector","for","each","state","-","shape",":","(","N",")","inputs_len","(","int","tensor",")",":","Lengths","of","states","in","a","batch","-","shape",":","(","batch",")","Returns",":","out","(","torch.FloatTensor",")",":","log","probability","of","transitioning","to","each","state"]
code: def forward(
      self, log_alpha_scaled, transition_vector, inputs_len
  ):  # pylint: disable=no-self-use
      r"""
      product of the past state with transitional probabilities in log space
  
      Args:
          log_alpha_scaled (torch.Tensor): Multiply previous timestep's alphas by
                      transition matrix (in log domain)
              - shape: (batch size, N)
          transition_vector (torch.tensor): transition vector for each state
              - shape: (N)
          inputs_len (int tensor): Lengths of states in a batch
              - shape: (batch)
  
      Returns:
          out (torch.FloatTensor): log probability of transitioning to each state
      """
      transition_p = torch.sigmoid(transition_vector)
      staying_p = torch.sigmoid(-transition_vector)
  
      log_staying_probability = OverflowUtils.log_clamped(staying_p)
      log_transition_probability = OverflowUtils.log_clamped(
          transition_p
      )
  
      staying = log_alpha_scaled + log_staying_probability
      leaving = log_alpha_scaled + log_transition_probability
      leaving = leaving.roll(1, dims=1)
      leaving[:, 0] = -float("inf")
      inputs_len_mask = sequence_mask(inputs_len)
      out = OverflowUtils.logsumexp(
          torch.stack((staying, leaving), dim=2), dim=2
      )
      out = out.masked_fill(
          ~inputs_len_mask, -float("inf")
      )  # There are no states to contribute to the loss
      return out
  
imports: from typing import List
  import torch
  import torch.distributions
  import torch.nn.functional
  from torch import nn
  from torch.utils.checkpoint import checkpoint
  from TTS.tts.layers.overflow.common_layers import Outputnet, OverflowUtils
  from TTS.tts.layers.tacotron.common_layers import Prenet
  from TTS.tts.utils.helpers import sequence_mask
label_desc: Use image node_id 1 for calling the TransitionModel obj's underlying member method code with example usage: obj.forward(log_alpha_scaled, transition_vector, inputs_len) and returns: out