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 913895d commit db68400Copy full SHA for db68400
python/apollocaffe/__init__.py
@@ -32,3 +32,17 @@ def base_parser():
32
return parser
33
34
set_cpp_loglevel(3)
35
+
36
+# Apollocaffe uses print() over the obscure python logging module
37
+# Disable buffering of stdout ,equivalent to export PYTHONUNBUFFERED=x
38
+class Unbuffered(object):
39
+ def __init__(self, stream):
40
+ self.stream = stream
41
+ def write(self, data):
42
+ self.stream.write(data)
43
+ self.stream.flush()
44
+ def __getattr__(self, attr):
45
+ return getattr(self.stream, attr)
46
47
+import sys
48
+sys.stdout = Unbuffered(sys.stdout)
0 commit comments