def _pad_to_full_instance_dim(keypoint_coords, keypoint_scores, instance_inds, max_instances):
    'Scatter keypoint elements into tensors with full instance 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    instance_inds: a list of integers that indicate the instance indices for\n      these keypoints. These indices are used to scatter into tensors\n      that have a `max_instances` dimension.\n    max_instances: The maximum number of instances detected by the model.\n\n  Returns:\n    A tuple with\n    keypoint_coords_padded: a [batch_size, max_instances, num_keypoints, 2]\n      float32 tensor.\n    keypoint_scores_padded: a [batch_size, max_instances, num_keypoints]\n      float32 tensor.\n  '
    (batch_size, _, num_keypoints, _) = shape_utils.combined_static_and_dynamic_shape(keypoint_coords)
    kpt_coords_transposed = tf.transpose(keypoint_coords, [1, 0, 2, 3])
    kpt_scores_transposed = tf.transpose(keypoint_scores, [1, 0, 2])
    instance_inds = tf.expand_dims(instance_inds, axis=(- 1))
    kpt_coords_scattered = tf.scatter_nd(indices=instance_inds, updates=kpt_coords_transposed, shape=[max_instances, batch_size, num_keypoints, 2])
    kpt_scores_scattered = tf.scatter_nd(indices=instance_inds, updates=kpt_scores_transposed, shape=[max_instances, batch_size, num_keypoints])
    keypoint_coords_padded = tf.transpose(kpt_coords_scattered, [1, 0, 2, 3])
    keypoint_scores_padded = tf.transpose(kpt_scores_scattered, [1, 0, 2])
    return (keypoint_coords_padded, keypoint_scores_padded)
Scatter keypoint elements into tensors with full instance 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.
  instance_inds: a list of integers that indicate the instance indices for
    these keypoints. These indices are used to scatter into tensors
    that have a `max_instances` dimension.
  max_instances: The maximum number of instances detected by the model.

Returns:
  A tuple with
  keypoint_coords_padded: a [batch_size, max_instances, num_keypoints, 2]
    float32 tensor.
  keypoint_scores_padded: a [batch_size, max_instances, num_keypoints]
    float32 tensor.
def _pad_to_full_instance_dim(keypoint_coords, keypoint_scores, instance_inds, max_instances):
    'Scatter keypoint elements into tensors with full instance 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    instance_inds: a list of integers that indicate the instance indices for\n      these keypoints. These indices are used to scatter into tensors\n      that have a `max_instances` dimension.\n    max_instances: The maximum number of instances detected by the model.\n\n  Returns:\n    A tuple with\n    keypoint_coords_padded: a [batch_size, max_instances, num_keypoints, 2]\n      float32 tensor.\n    keypoint_scores_padded: a [batch_size, max_instances, num_keypoints]\n      float32 tensor.\n  '
    (batch_size, _, num_keypoints, _) = shape_utils.combined_static_and_dynamic_shape(keypoint_coords)
    kpt_coords_transposed = tf.transpose(keypoint_coords, [1, 0, 2, 3])
    kpt_scores_transposed = tf.transpose(keypoint_scores, [1, 0, 2])
    instance_inds = tf.expand_dims(instance_inds, axis=(- 1))
    kpt_coords_scattered = tf.scatter_nd(indices=instance_inds, updates=kpt_coords_transposed, shape=[max_instances, batch_size, num_keypoints, 2])
    kpt_scores_scattered = tf.scatter_nd(indices=instance_inds, updates=kpt_scores_transposed, shape=[max_instances, batch_size, num_keypoints])
    keypoint_coords_padded = tf.transpose(kpt_coords_scattered, [1, 0, 2, 3])
    keypoint_scores_padded = tf.transpose(kpt_scores_scattered, [1, 0, 2])
    return (keypoint_coords_padded, keypoint_scores_padded)