class_docstr: Step-by-step decoder with LM fusion.
class_docstr_tok: ["Step-by-step","decoder","with","LM","fusion","."]
code: def _InitBeamSearchStateCallback(
      self, theta, encoder_outputs, num_hyps_per_beam
  ):
      p = self.params
      num_hyps = self._GetNumHypsForBeamSearch(
          encoder_outputs.encoded, num_hyps_per_beam
      )
      (
          rnn_states,
          atten_context,
          atten_probs,
          atten_states,
          fusion_states,
          misc_states,
          packed_src,
      ) = self.InitDecoder(theta, encoder_outputs, num_hyps)
      # Throw away packed_src. We re-compute it in _PreBeamSearchStepCallback
      # because we cannot pass 'packed_src' through 'states'. beam_search_helper
      # assumes that all Tensors in 'states' have 'target_batch' as the first
      # dimension.
      del packed_src
      atten_probs = self._PostProcessAttenProbsForBeamSearch(
          atten_probs
      )
      all_atten_states = py_utils.NestedMap(
          {
              "atten_context": atten_context,
              "atten_probs": atten_probs,
              "atten_states": atten_states,
          }
      )
  
      initial_results = py_utils.NestedMap(
          {
              "log_probs": tf.nn.log_softmax(
                  tf.zeros(
                      [num_hyps, p.softmax.num_classes],
                      dtype=py_utils.FPropDtype(p),
                  )
              ),
              "atten_probs": atten_probs,
          }
      )
      other_states = py_utils.NestedMap(
          {
              "rnn_states": rnn_states,
              "all_atten_states": all_atten_states,
              "fusion_states": fusion_states,
              "misc_states": misc_states,
          }
      )
      return initial_results, other_states
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import math
  import lingvo.compat
  from lingvo.core import attention
  from lingvo.core import base_decoder
  from lingvo.core import base_layer
  from lingvo.core import cluster_factory
  from lingvo.core import layers
  from lingvo.core import plot
  from lingvo.core import py_utils
  from lingvo.core import recurrent
  from lingvo.core import rnn_cell
  from lingvo.core import summary_utils
  from lingvo.core import symbolic
  from lingvo.tasks.asr import contextualizer_base
  from lingvo.tasks.asr import decoder_utils
  from lingvo.tasks.asr import fusion
  from matplotlib import font_manager
  import six
  from six.moves import range
label_desc: Use image node_id 7 for calling the AsrDecoder obj's underlying member method code with example usage: obj._InitBeamSearchStateCallback(theta, encoder_outputs, num_hyps_per_beam) and returns: initial_results,  other_states