def _pad_to_full_keypoint_dim(keypoint_coords, keypoint_scores, keypoint_inds, num_total_keypoints):
    'Scatter keypoint elements into tensors with full keypoints dimension.\n\n  Args:\n    keypoint_coords: a [batch_size, num_instances, num_keypoints, 2] float32\n      tensor.\n    keypoint_scores: a [batch_size, num_instances, num_keypoints] float32\n      tensor.\n    keypoint_inds: a list of integers that indicate the keypoint indices for\n      this specific keypoint class. These indices are used to scatter into\n      tensors that have a `num_total_keypoints` dimension.\n    num_total_keypoints: The total number of keypoints that this model predicts.\n\n  Returns:\n    A tuple with\n    keypoint_coords_padded: a\n      [batch_size, num_instances, num_total_keypoints,2] float32 tensor.\n    keypoint_scores_padded: a [batch_size, num_instances, num_total_keypoints]\n      float32 tensor.\n  '
    (batch_size, num_instances, _, _) = shape_utils.combined_static_and_dynamic_shape(keypoint_coords)
    kpt_coords_transposed = tf.transpose(keypoint_coords, [2, 0, 1, 3])
    kpt_scores_transposed = tf.transpose(keypoint_scores, [2, 0, 1])
    kpt_inds_tensor = tf.expand_dims(keypoint_inds, axis=(- 1))
    kpt_coords_scattered = tf.scatter_nd(indices=kpt_inds_tensor, updates=kpt_coords_transposed, shape=[num_total_keypoints, batch_size, num_instances, 2])
    kpt_scores_scattered = tf.scatter_nd(indices=kpt_inds_tensor, updates=kpt_scores_transposed, shape=[num_total_keypoints, batch_size, num_instances])
    keypoint_coords_padded = tf.transpose(kpt_coords_scattered, [1, 2, 0, 3])
    keypoint_scores_padded = tf.transpose(kpt_scores_scattered, [1, 2, 0])
    return (keypoint_coords_padded, keypoint_scores_padded)
Scatter keypoint elements into tensors with full keypoints dimension.

Args:
  keypoint_coords: a [batch_size, num_instances, num_keypoints, 2] float32
    tensor.
  keypoint_scores: a [batch_size, num_instances, num_keypoints] float32
    tensor.
  keypoint_inds: a list of integers that indicate the keypoint indices for
    this specific keypoint class. These indices are used to scatter into
    tensors that have a `num_total_keypoints` dimension.
  num_total_keypoints: The total number of keypoints that this model predicts.

Returns:
  A tuple with
  keypoint_coords_padded: a
    [batch_size, num_instances, num_total_keypoints,2] float32 tensor.
  keypoint_scores_padded: a [batch_size, num_instances, num_total_keypoints]
    float32 tensor.
def _pad_to_full_keypoint_dim(keypoint_coords, keypoint_scores, keypoint_inds, num_total_keypoints):
    'Scatter keypoint elements into tensors with full keypoints dimension.\n\n  Args:\n    keypoint_coords: a [batch_size, num_instances, num_keypoints, 2] float32\n      tensor.\n    keypoint_scores: a [batch_size, num_instances, num_keypoints] float32\n      tensor.\n    keypoint_inds: a list of integers that indicate the keypoint indices for\n      this specific keypoint class. These indices are used to scatter into\n      tensors that have a `num_total_keypoints` dimension.\n    num_total_keypoints: The total number of keypoints that this model predicts.\n\n  Returns:\n    A tuple with\n    keypoint_coords_padded: a\n      [batch_size, num_instances, num_total_keypoints,2] float32 tensor.\n    keypoint_scores_padded: a [batch_size, num_instances, num_total_keypoints]\n      float32 tensor.\n  '
    (batch_size, num_instances, _, _) = shape_utils.combined_static_and_dynamic_shape(keypoint_coords)
    kpt_coords_transposed = tf.transpose(keypoint_coords, [2, 0, 1, 3])
    kpt_scores_transposed = tf.transpose(keypoint_scores, [2, 0, 1])
    kpt_inds_tensor = tf.expand_dims(keypoint_inds, axis=(- 1))
    kpt_coords_scattered = tf.scatter_nd(indices=kpt_inds_tensor, updates=kpt_coords_transposed, shape=[num_total_keypoints, batch_size, num_instances, 2])
    kpt_scores_scattered = tf.scatter_nd(indices=kpt_inds_tensor, updates=kpt_scores_transposed, shape=[num_total_keypoints, batch_size, num_instances])
    keypoint_coords_padded = tf.transpose(kpt_coords_scattered, [1, 2, 0, 3])
    keypoint_scores_padded = tf.transpose(kpt_scores_scattered, [1, 2, 0])
    return (keypoint_coords_padded, keypoint_scores_padded)