本文整理汇总了Python中official.utils.logs.logger.config_benchmark_logger方法的典型用法代码示例。如果您正苦于以下问题:Python logger.config_benchmark_logger方法的具体用法?Python logger.config_benchmark_logger怎么用?Python logger.config_benchmark_logger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类official.utils.logs.logger
的用法示例。
在下文中一共展示了logger.config_benchmark_logger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_config_base_benchmark_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_base_benchmark_logger(self):
with flagsaver.flagsaver(benchmark_logger_type="BaseBenchmarkLogger"):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BaseBenchmarkLogger)
示例2: test_config_benchmark_file_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_benchmark_file_logger(self):
# Set the benchmark_log_dir first since the benchmark_logger_type will need
# the value to be set when it does the validation.
with flagsaver.flagsaver(benchmark_log_dir="/tmp"):
with flagsaver.flagsaver(benchmark_logger_type="BenchmarkFileLogger"):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BenchmarkFileLogger)
示例3: test_config_benchmark_bigquery_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_benchmark_bigquery_logger(self, mock_bigquery_client):
with flagsaver.flagsaver(benchmark_logger_type="BenchmarkBigQueryLogger"):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BenchmarkBigQueryLogger)
示例4: test_config_base_benchmark_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_base_benchmark_logger(self):
with flagsaver.flagsaver(benchmark_logger_type='BaseBenchmarkLogger'):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BaseBenchmarkLogger)
示例5: test_config_benchmark_file_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_benchmark_file_logger(self):
# Set the benchmark_log_dir first since the benchmark_logger_type will need
# the value to be set when it does the validation.
with flagsaver.flagsaver(benchmark_log_dir='/tmp'):
with flagsaver.flagsaver(benchmark_logger_type='BenchmarkFileLogger'):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BenchmarkFileLogger)
示例6: test_config_benchmark_bigquery_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_benchmark_bigquery_logger(self, mock_bigquery_client):
with flagsaver.flagsaver(benchmark_logger_type='BenchmarkBigQueryLogger'):
logger.config_benchmark_logger()
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BenchmarkBigQueryLogger)
示例7: get_logging_metric_hook
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def get_logging_metric_hook(benchmark_log_dir=None,
tensors_to_log=None,
every_n_secs=600,
**kwargs): # pylint: disable=unused-argument
"""Function to get LoggingMetricHook.
Args:
benchmark_log_dir: `string`, directory path to save the metric log.
tensors_to_log: List of tensor names or dictionary mapping labels to tensor
names. If not set, log _TENSORS_TO_LOG by default.
every_n_secs: `int`, the frequency for logging the metric. Default to every
10 mins.
Returns:
Returns a ProfilerHook that writes out timelines that can be loaded into
profiling tools like chrome://tracing.
"""
logger.config_benchmark_logger(benchmark_log_dir)
if tensors_to_log is None:
tensors_to_log = _TENSORS_TO_LOG
return metric_hook.LoggingMetricHook(
tensors=tensors_to_log,
metric_logger=logger.get_benchmark_logger(),
every_n_secs=every_n_secs)
# A dictionary to map one hook name and its corresponding function
示例8: test_config_base_benchmark_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_base_benchmark_logger(self):
logger.config_benchmark_logger("")
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BaseBenchmarkLogger)
示例9: test_config_benchmark_file_logger
# 需要导入模块: from official.utils.logs import logger [as 别名]
# 或者: from official.utils.logs.logger import config_benchmark_logger [as 别名]
def test_config_benchmark_file_logger(self):
logger.config_benchmark_logger("/tmp/abc")
self.assertIsInstance(logger.get_benchmark_logger(),
logger.BenchmarkFileLogger)