We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3f4f4b commit 398f4e8Copy full SHA for 398f4e8
tests/data/horovod/test_hvd_basic.py
@@ -1,11 +1,15 @@
1
import json
2
import os
3
+
4
import horovod.tensorflow as hvd
5
-hvd.init()
6
+if __name__ == '__main__':
7
8
+ hvd.init()
9
10
+ with open(os.path.join('/opt/ml/model/rank-%s' % hvd.rank()), 'w+') as f:
11
+ basic_info = {'rank': hvd.rank(), 'size': hvd.size()}
12
-with open(os.path.join('/opt/ml/model/rank-%s' % hvd.rank()), 'w+') as f:
- basic_info = {'rank': hvd.rank(), 'size': hvd.size()}
13
+ json.dump(basic_info, f)
14
+ print('Saved file "rank-%s": %s' % (hvd.rank(), basic_info))
15
- print(basic_info)
- json.dump(basic_info, f)
0 commit comments