MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / SummaryWriterExtend

Class SummaryWriterExtend

imperative/python/megengine/utils/tensorboard.py:116–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116class SummaryWriterExtend(SummaryWriter):
117 def __init__(
118 self,
119 logdir=None,
120 comment="",
121 purge_step=None,
122 max_queue=10,
123 flush_secs=120,
124 filename_suffix="",
125 write_to_disk=True,
126 log_dir=None,
127 **kwargs
128 ):
129 self.node_raw_dict = {}
130 super().__init__(
131 logdir,
132 comment,
133 purge_step,
134 max_queue,
135 flush_secs,
136 filename_suffix,
137 write_to_disk,
138 log_dir,
139 **kwargs,
140 )
141
142 def add_text(self, tag, text_string_list, global_step=None, walltime=None):
143 """Add text data to summary.
144
145 Args:
146 tag (string): Data identifier
147 text_string_list (string list): String to save
148 global_step (int): Global step value to record
149 walltime (float): Optional override default walltime (time.time())
150 seconds after epoch of event
151
152 Examples:
153
154 .. code-block:: python
155
156 # text can be divided into three levels by tag and global_step
157 from writer import SummaryWriterExtend
158 writer = SummaryWriterExtend()
159
160 writer.add_text('level1.0/level2.0', ['text0'], 0)
161 writer.add_text('level1.0/level2.0', ['text1'], 1)
162 writer.add_text('level1.0/level2.1', ['text2'])
163 writer.add_text('level1.1', ['text3'])
164 """
165
166 self._get_file_writer().add_summary(
167 text(tag, text_string_list), global_step, walltime
168 )
169
170 def add_node_raw(
171 self,
172 name,
173 op="UnSpecified",

Callers 1

convertFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected