import tensorflow as tf

  decoded = tf.cast(tf.sparse.to_dense(decoded), tf.int32)
  decoded_u = tf.sparse.SparseTensor(indices_u[0], values_u[0], shape_u[0])
  decoded_u = tf.cast(tf.sparse.to_dense(decoded_u), tf.int32)
  # Adjust event vals according to representation
  decoded = tf.where(tf.not_equal(decoded, 0), decoded+shift, decoded)
  decoded_u = tf.where(tf.not_equal(decoded_u, 0), decoded_u+shift, decoded_u)
  # Set default vals
  decoded = tf.where(tf.equal(decoded, 0), def_val, decoded)
