def _save_gin(output_dir, sw=None):
  config_path = os.path.join(output_dir, 'config.gin')
  config_str = gin.operative_config_str()
  with gfile.GFile(config_path, 'w') as f:
    f.write(config_str)
  if sw:
    sw.text('gin_config',
            jaxboard.markdownify_operative_config_str(config_str))
Beispiel #2
0
 def save_gin(self):
     config_path = os.path.join(self._output_dir, 'config.gin')
     config_str = gin.operative_config_str()
     with tf.io.gfile.GFile(config_path, 'w') as f:
         f.write(config_str)
     sw = self._train_sw
     if sw:
         sw.text('gin_config',
                 jaxboard.markdownify_operative_config_str(config_str))
Beispiel #3
0
 def save_gin(self):
   assert self._output_dir is not None
   config_path = os.path.join(self._output_dir, 'config.gin')
   config_str = gin.operative_config_str()
   with tf.io.gfile.GFile(config_path, 'w') as f:
     f.write(config_str)
   if self._sw:
     self._sw.text('gin_config',
                   jaxboard.markdownify_operative_config_str(config_str))
Beispiel #4
0
 def _save_gin(self, summary_writer):
   """"Saves the operative gin config."""
   if not self.is_chief or self._output_dir is None:
     return
   config_path = os.path.join(self._output_dir, 'config.gin')
   config_str = gin.operative_config_str()
   with tf.io.gfile.GFile(config_path, 'w') as f:
     f.write(config_str)
   if summary_writer is not None:
     summary_writer.text(
         'gin_config', jaxboard.markdownify_operative_config_str(config_str)
     )
Beispiel #5
0
 def save_gin(self):
     """"Saves the operative gin config, only if it is the chief."""
     if not self._is_chief:
         return
     assert self._output_dir is not None
     config_path = os.path.join(self._output_dir, 'config.gin')
     config_str = gin.operative_config_str()
     with tf.io.gfile.GFile(config_path, 'w') as f:
         f.write(config_str)
     sw = self._train_sw
     if sw:
         sw.text('gin_config',
                 jaxboard.markdownify_operative_config_str(config_str))