def _verify_variational_params(variational_params):
  """Verifies that the format of the input `variational_params`.

  Checks that the input parameters is a 2-tuple of tensors of equal shape.

  Args:
    variational_params: The parameters to check.

  Raises:
    RuntimeError: If the input is not a 2-tuple of tensors with equal shape.

  Returns:
    The input `variational_parameters`.
  """
  if len(variational_params) != 2:
    raise RuntimeError("Incorrect number of variational parameters.")
  if variational_params[0].shape != variational_params[1].shape:
    raise RuntimeError("Variational parameters must be the same shape.")
  return variational_params