def _maybe_dump(self): if not (self._step in self._dump_steps or self._dump_next_step): return if not gfile.Exists(self._profiler_dir): gfile.MakeDirs(self._profiler_dir) print_mdl.WriteProfile( os.path.join(compat.as_bytes(self._profiler_dir), compat.as_bytes('profile_%d' % self._step)))
def _write_profile(self, filename): """Writes the profile to a file.""" print_mdl.WriteProfile(filename)