class_docstr: A wrapper for pytorch RNNLM.
class_docstr_tok: ["A","wrapper","for","pytorch","RNNLM","."]
docstr: Predict final log probabilities for given state using the predictor.
  
  :param state: The state
  :return The final log probabilities
  :rtype torch.Tensor
docstr_tok: ["Predict","final","log","probabilities","for","given","state","using","the","predictor",".",":","param","state",":","The","state",":","return","The","final","log","probabilities",":","rtype","torch.Tensor"]
code: def final(self, state, index=None):
      """Predict final log probabilities for given state using the predictor.
  
      :param state: The state
      :return The final log probabilities
      :rtype torch.Tensor
      """
      if hasattr(self.predictor, "final"):
          if index is not None:
              return self.predictor.final(state[index])
          else:
              return self.predictor.final(state)
      else:
          return 0.0
  
imports: import logging
  from typing import Any, List, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from espnet.nets.lm_interface import LMInterface
  from espnet.nets.pytorch_backend.e2e_asr import to_device
  from espnet.nets.scorer_interface import BatchScorerInterface
  from espnet.utils.cli_utils import strtobool
label_desc: Use image node_id 5 for calling the ClassifierWithState obj's underlying member method code with example usage: obj.final(state, index) and returns: int, self, self