import tensorflow as tf

    blank_index: The index of blank which will be set to def_val (or None)
    def_val: The value associated with the default event
    shift: Necessary shift to convert to representation
  Returns:
    decoded: The decoded sequence [seq_length]
  """
  # Infer predictions using argmax
  decoded = tf.cast(tf.argmax(inputs, axis=-1), tf.int32)
  # Adjust event vals according to representation
  decoded = tf.where(tf.not_equal(decoded, 0), decoded+shift, decoded)
  # Set default vals
  decoded = tf.where(tf.equal(decoded, 0), def_val, decoded)
  return decoded, None

@tf.function
def ctc_decode(inputs, batch_size, seq_length, blank_index, def_val, shift, beam_width=10):
  """Perform ctc decoding"""
  # Decode uses time major
