def _is_model(layer):
  """Returns True if layer is a model.

  Args:
    layer: a dict representing a Keras model configuration.

  Returns:
    bool: True if layer is a model.
  """
  return layer.get('config').get('layers') is not None