(logits,
                      sequence_length,
                      merge_repeated=True,
                      blank_id=None)
return decode_result, probs
ctc greedy decode function
    param: logits, (B, T, C), output of ctc asr model
    param: sequence_length, (B, 1), sequence lengths
    param: merge_repeated, boolean, if merge consecutive repeated classes in output
    returns:
        decode_result, (B, T), decode result
        probs, (B), A float matrix containing, for the sequence found,
            the negative of the sum of the greatest logit at each timeframe.
ctc greedy decode function
    param: logits, (B, T, C), output of ctc asr model
    param: sequence_length, (B, 1), sequence lengths
    param: merge_repeated, boolean, if merge consecutive repeated classes in output
    returns:
        decode_result, (B, T), decode result
        probs, (B), A float matrix containing, for the sequence found,
            the negative of the sum of the greatest logit at each timeframe.
ctc greedy decode function param : logits ( B T C ) output of ctc asr model param : sequence_length ( B 1 ) sequence lengths param : merge_repeated boolean if merge consecutive repeated classes in output returns : decode_result ( B T ) decode result probs ( B ) A float matrix containing for the sequence found the negative of the sum of the greatest logit at each timeframe .
def ctc_greedy_decode(logits,
                      sequence_length,
                      merge_repeated=True,
                      blank_id=None):
  '''
    ctc greedy decode function
    param: logits, (B, T, C), output of ctc asr model
    param: sequence_length, (B, 1), sequence lengths
    param: merge_repeated, boolean, if merge consecutive repeated classes in output
    returns:
        decode_result, (B, T), decode result
        probs, (B), A float matrix containing, for the sequence found,
            the negative of the sum of the greatest logit at each timeframe.
    '''

  logits, sequence_len, blank_id = ctc_decode_blankid_to_last(
      logits, sequence_length, blank_id)
  deps = [
      tf.assert_rank(logits, 3),
      tf.assert_rank(sequence_len, 1),
  ]

  with tf.control_dependencies(deps):
    decode_result, probs = tf.nn.ctc_greedy_decoder(
        logits, sequence_len, merge_repeated=merge_repeated)
    decode_result = [
        ctc_utils.labels_last_to_blankid(single_decode_result, blank_id)
        for single_decode_result in decode_result
    ]
    decode_result = tf.sparse_tensor_to_dense(
        decode_result[0], default_value=blank_id, name="outputs")
  return decode_result, probs
def ctc_greedy_decode ( logits , sequence_length , merge_repeated = True , blank_id = None ) : logits , sequence_len , blank_id = ctc_decode_blankid_to_last ( logits , sequence_length , blank_id ) deps = [ tf . assert_rank ( logits , 3 ) , tf . assert_rank ( sequence_len , 1 ) , ] with tf . control_dependencies ( deps ) : decode_result , probs = tf . nn . ctc_greedy_decoder ( logits , sequence_len , merge_repeated = merge_repeated ) decode_result = [ ctc_utils . labels_last_to_blankid ( single_decode_result , blank_id ) for single_decode_result in decode_result ] decode_result = tf . sparse_tensor_to_dense ( decode_result [ 0 ] , default_value = blank_id , name = "outputs" ) return decode_result , probs