code: def ragged_to_dense(labels, predictions, weights):
      """Converts given inputs from ragged tensors to dense tensors.
  
      Args:
        labels: A `tf.RaggedTensor` of the same shape as `predictions` representing
          relevance.
        predictions: A `tf.RaggedTensor` with shape [batch_size, (list_size)]. Each
          value is the ranking score of the corresponding example.
        weights: An optional `tf.RaggedTensor` of the same shape of predictions or a
          `tf.Tensor` of shape [batch_size, 1]. The former case is per-example and
          the latter case is per-list.
  
      Returns:
        A tuple (labels, predictions, weights, mask) of dense `tf.Tensor`s.
      """
      # TODO: Add checks to validate (ragged) shapes of input tensors.
      mask = tf.cast(tf.ones_like(labels).to_tensor(0.0), dtype=tf.bool)
      labels = labels.to_tensor(_PADDING_LABEL)
      if predictions is not None:
          predictions = predictions.to_tensor(_PADDING_PREDICTION)
      if isinstance(weights, tf.RaggedTensor):
          weights = weights.to_tensor(_PADDING_WEIGHT)
      return labels, predictions, weights, mask
  
file_path: ranking/tensorflow_ranking/python/utils.py
imports: from typing import Callable, Dict, Tuple
  import tensorflow
label_desc: Use image node_id 14 for calling a global function with example usage: ragged_to_dense(labels, predictions, weights) and returns: labels,  predictions,  weights,  mask