def dimensions_are_compatible(op_regularizer):
  """Checks if op_regularizer's alive_vector matches regularization_vector."""
  return op_regularizer.alive_vector.shape.with_rank(1).dims[
      0].is_compatible_with(
          op_regularizer.regularization_vector.shape.with_rank(1).dims[0])