def _object_import_from_string(name):
  """Import and return an object from a string import path.

  Args:
    name (str): A string import path
        (e.g. "tf.train.AdamOptimizer")

  Returns:
    obj: The imported Python object

  """
  components = name.split('.')
  mod = __import__(components[0])
  for comp in components[1:]:
    mod = getattr(mod, comp)
  return mod