MCPcopy
hub / github.com/facebookresearch/mmf / write

Method write

pythia/utils/logger.py:88–105  ·  view source on GitHub ↗
(self, x, level="info", donot_print=False, log_all=False)

Source from the content-addressed store, hash-verified

86 self.summary_writer.close()
87
88 def write(self, x, level="info", donot_print=False, log_all=False):
89 if self.logger is None:
90 return
91
92 if log_all is False and not self._is_main_process:
93 return
94
95 # if it should not log then just print it
96 if self.should_log:
97 if hasattr(self.logger, level):
98 if donot_print:
99 getattr(self._file_only_logger, level)(str(x))
100 else:
101 getattr(self.logger, level)(str(x))
102 else:
103 self.logger.error("Unknown log level type: %s" % level)
104 else:
105 print(str(x) + "\n")
106
107 def single_write(self, x, level="info"):
108 if x + "_" + level in self._single_log_map:

Callers 15

single_writeMethod · 0.95
runFunction · 0.80
download_fileFunction · 0.80
pretty_printMethod · 0.80
save_configMethod · 0.80
_loadMethod · 0.80
restoreMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
_load_fasttext_modelMethod · 0.80
build_modelFunction · 0.80

Calls

no outgoing calls

Tested by 2

next_datasetMethod · 0.64
flush_reportMethod · 0.64