class_docstr: @property
  def input_types(self):
      """Returns definitions of module input ports.
      """
      return {
          "log_probs": NeuralType(('B', 'T', 'D'), LogprobsType()),
      }
  
  @property
  def output_types(self):
      """Returns definitions of module output ports.
      """
      return {"hypos": NeuralType(('B'), PredictionsType())}
code: def forward(self, log_probs: Union[np.ndarray, torch.Tensor]):
      if isinstance(log_probs, np.ndarray):
          log_probs = torch.from_numpy(log_probs).float()
      if log_probs.dim() == 2:
          log_probs = log_probs.unsqueeze(0)
  
      emissions = log_probs.cpu().contiguous()
  
      B, T, N = emissions.size()
      hypos = []
      # we iterate over the batch dimension of our input tensor log probabilities
      for b in range(B):
          # the flashlight C++ expects a C style pointer, so the memory address
          # which is what we obtain here. Then we pass it to pybinding method which
          # is bound to the underlying C++ code
          emissions_ptr = (
              emissions.data_ptr() + 4 * b * emissions.stride(0)
          )
          results = self.decoder.decode(emissions_ptr, T, N)
  
          hypos.append(
              [
                  {
                      "tokens": self._get_tokens(result.tokens),
                      "score": result.score,
                      "timesteps": self._get_timesteps(result.tokens),
                      "words": [
                          self.word_dict.get_entry(x)
                          for x in result.words
                          if x >= 0
                      ],
                  }
                  for result in results
              ]
          )
  
      return hypos
  
imports: import itertools
  import math
  from typing import Iterable, List, Optional, Tuple, Union
  import numpy
  import torch
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.core.classes import NeuralModule, typecheck
  from nemo.core.neural_types import LengthsType, LogprobsType, NeuralType, PredictionsType
label_desc: Use image node_id 4 for calling the FlashLightKenLMBeamSearchDecoder obj's underlying member method code with example usage: obj.forward(log_probs) and returns: hypos