MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / write

Method write

dnnlib/util.py:78–91  ·  view source on GitHub ↗

Write text to stdout (and a file) and optionally flush.

(self, text: Union[str, bytes])

Source from the content-addressed store, hash-verified

76 self.close()
77
78 def write(self, text: Union[str, bytes]) -> None:
79 """Write text to stdout (and a file) and optionally flush."""
80 if isinstance(text, bytes):
81 text = text.decode()
82 if len(text) == 0: # workaround for a bug in VSCode debugger: sys.stdout.write(''); sys.stdout.flush() => crash
83 return
84
85 if self.file is not None:
86 self.file.write(text)
87
88 self.stdout.write(text)
89
90 if self.should_flush:
91 self.flush()
92
93 def flush(self) -> None:
94 """Flush written text to both stdout and a file, if open."""

Callers 2

training_loopFunction · 0.45
open_urlFunction · 0.45

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected