(default_dir, backend_name)
| 4 | |
| 5 | |
| 6 | def set_default_backend(default_dir, backend_name): |
| 7 | os.makedirs(default_dir, exist_ok=True) |
| 8 | config_path = os.path.join(default_dir, "config.json") |
| 9 | with open(config_path, "w") as config_file: |
| 10 | json.dump({"backend": backend_name.lower()}, config_file) |
| 11 | print( |
| 12 | 'Setting the default backend to "{}". You can change it in the ' |
| 13 | "~/.dgl/config.json file or export the DGLBACKEND environment variable. " |
| 14 | "Valid options are: pytorch, mxnet, tensorflow (all lowercase)".format( |
| 15 | backend_name |
| 16 | ) |
| 17 | ) |
| 18 | |
| 19 | |
| 20 | if __name__ == "__main__": |
no test coverage detected