当前位置: 首页>>代码示例>>Python>>正文


Python gin.operative_config_str方法代码示例

本文整理汇总了Python中gin.operative_config_str方法的典型用法代码示例。如果您正苦于以下问题:Python gin.operative_config_str方法的具体用法?Python gin.operative_config_str怎么用?Python gin.operative_config_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gin的用法示例。


在下文中一共展示了gin.operative_config_str方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _save_gin

# 需要导入模块: import gin [as 别名]
# 或者: from gin import operative_config_str [as 别名]
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)) 
开发者ID:yyht,项目名称:BERT,代码行数:10,代码来源:trax.py

示例2: save_gin

# 需要导入模块: import gin [as 别名]
# 或者: from gin import operative_config_str [as 别名]
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)) 
开发者ID:google,项目名称:trax,代码行数:11,代码来源:training.py

示例3: save_gin

# 需要导入模块: import gin [as 别名]
# 或者: from gin import operative_config_str [as 别名]
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)) 
开发者ID:google,项目名称:trax,代码行数:15,代码来源:trainer_lib.py

示例4: save_gin_config

# 需要导入模块: import gin [as 别名]
# 或者: from gin import operative_config_str [as 别名]
def save_gin_config(self):
        with open(self.config_path, 'w') as cfg_file:
            cfg_file.write(gin.operative_config_str()) 
开发者ID:inoryy,项目名称:reaver,代码行数:5,代码来源:experiment.py

示例5: record_operative_gin_configurations

# 需要导入模块: import gin [as 别名]
# 或者: from gin import operative_config_str [as 别名]
def record_operative_gin_configurations(operative_config_dir):
  """Record operative Gin configurations in the given directory."""
  gin_log_file = operative_config_path(operative_config_dir)
  # If it exists already, rename it instead of overwriting it.
  # This just saves the previous one, not all the ones before.
  if tf.io.gfile.exists(gin_log_file):
    tf.io.gfile.rename(gin_log_file, gin_log_file + '.old', overwrite=True)
  with tf.io.gfile.GFile(gin_log_file, 'w') as f:
    f.write(gin.operative_config_str()) 
开发者ID:google-research,项目名称:meta-dataset,代码行数:11,代码来源:train.py


注:本文中的gin.operative_config_str方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。