code: def pad_with_zeros(logits, labels):
    
    with tf.name_scope("pad_with_zeros", values=[logits, labels]):
      logits, labels = pad_to_same_length(logits, labels)
      if len(labels.shape) == 3:  # 2-d labels.
        logits, labels = pad_to_same_length(logits, labels, axis=2)
      return logits, labels
docs: Pad labels on the length dimension to match logits length.