code: def length_from_embedding(emb):
    
    return tf.cast(tf.reduce_sum(mask_from_embedding(emb), [1, 2, 3]), tf.int32)
docs: Compute the length of each sequence in the batch.
  
    Args:
      emb: a sequence embedding Tensor with shape [batch, max_time, 1, depth].
    Returns:
      a Tensor with shape [batch].