You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

backend.py 593 B

12345678910111213141516171819202122232425
  1. import os
  2. import autogl
  3. def test_backend():
  4. environ = os.environ.get("AUTOGL_BACKEND", None)
  5. backend_name = autogl.backend.DependentBackend.get_backend_name()
  6. if environ in ['pyg', 'dgl']:
  7. assert backend_name == environ
  8. else:
  9. try:
  10. import dgl
  11. assert backend_name == 'dgl'
  12. return
  13. except ImportError:
  14. pass
  15. try:
  16. import torch_geometric
  17. assert backend_name == 'pyg'
  18. return
  19. except ImportError:
  20. pass
  21. if __name__ == '__main__':
  22. test_backend()