code: def _generate_step_fn(self, sequences, states, scores):
      # This acts as a binary counter for testing purposes. For scoring, zeros
      # accumulate value exponentially in the state, ones "cash in". The highest-
      # scoring sequence would be all zeros followed by a single one.
      value = 0
      for i, seq in enumerate(sequences):
          seq.append(value)
          if value == 0:
              states[i] *= 2
          else:
              scores[i] += states[i]
              states[i] = 1
          if (i - 1) % (2 ** len(seq)) == 0:
              value = 1 - value
      return sequences, states, scores
  
file_path: magenta/magenta/common/beam_search_test.py
imports: from magenta.common import beam_search
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the BeamSearchTest obj's underlying member method code with example usage: obj._generate_step_fn(sequences, states, scores) and returns: sequences,  states,  scores