class_docstr: Beam search implementation for Transducer.
docstr: Greedy search implementation.
  
  Args:
      enc_out: Encoder output sequence. (T, D_enc)
  
  Returns:
      hyp: 1-best hypotheses.
docstr_tok: ["Greedy","search","implementation",".","Args",":","enc_out",":","Encoder","output","sequence",".","(","T",",","D_enc",")","Returns",":","hyp",":","1-best","hypotheses","."]
code: def greedy_search(self, enc_out: torch.Tensor) -> List[Hypothesis]:
      """Greedy search implementation.
  
      Args:
          enc_out: Encoder output sequence. (T, D_enc)
  
      Returns:
          hyp: 1-best hypotheses.
  
      """
      dec_state = self.decoder.init_state(1)
  
      hyp = Hypothesis(
          score=0.0, yseq=[self.blank_id], dec_state=dec_state
      )
      cache = {}
  
      dec_out, state, _ = self.decoder.score(hyp, cache)
  
      for enc_out_t in enc_out:
          logp = torch.log_softmax(
              self.joint_network(enc_out_t, dec_out),
              dim=-1,
          )
          top_logp, pred = torch.max(logp, dim=-1)
  
          if pred != self.blank_id:
              hyp.yseq.append(int(pred))
              hyp.score += float(top_logp)
  
              hyp.dec_state = state
  
              dec_out, state, _ = self.decoder.score(hyp, cache)
  
      return [hyp]
  
imports: import logging
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.asr_transducer.joint_network import JointNetwork
  from espnet2.lm.transformer_lm import TransformerLM
  from espnet.nets.beam_search import Hypothesis
  from espnet.nets.pytorch_backend.transducer.utils import is_prefix, recombine_hyps, select_k_expansions, subtract
label_desc: Use image node_id 6 for calling the BeamSearchTransducerStreaming obj's underlying member method code with example usage: obj.greedy_search(enc_out) and returns: list