def _validate_observation_data(<EOL>kernel, observation_index_points, observations):
<EOL>ndims = kernel.feature_ndims<EOL>if (tensorshape_util.is_fully_defined(<EOL>observation_index_points.shape[:-ndims]) and<EOL>tensorshape_util.is_fully_defined(observations.shape)):<EOL><INDENT>index_point_count = observation_index_points.shape[:-ndims]<EOL>observation_count = observations.shape<EOL>try:<EOL><INDENT>tf.broadcast_static_shape(index_point_count, observation_count)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>index_point_count, observation_count))<EOL><DEDENT><DEDENT>
Ensure that observation data and locations have consistent shapes.

    This basically means that the batch shapes are broadcastable. We can only
    ensure this when those shapes are fully statically defined.


    Args:
      kernel: The GP kernel.
      observation_index_points: the observation data locations in the index set.
      observations: the observation data.

    Raises:
      ValueError: if the observations' batch shapes are not broadcastable.