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


Python writer.FileWriter方法代码示例

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


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

示例1: __new__

# 需要导入模块: from tensorflow.python.summary.writer import writer [as 别名]
# 或者: from tensorflow.python.summary.writer.writer import FileWriter [as 别名]
def __new__(cls, logdir):
        """ Creates a singleton instance.

        Args:
            logdir: A string, the directory for saving summaries.

        Returns: The instance.
        """
        assert logdir is not None and logdir != "", \
            "need model_dir to initialize SummaryWriter"
        if SummaryWriter.__instance is None:
            SummaryWriter.__instance = super(
                SummaryWriter, cls).__new__(cls)
            fw = FileWriter(logdir, graph=ops.get_default_graph())
            setattr(SummaryWriter.__instance, "_summary_writer", fw)
            setattr(SummaryWriter.__instance, "add_graph", fw.add_graph)
            setattr(SummaryWriter.__instance, "add_meta_graph", fw.add_meta_graph)
            setattr(SummaryWriter.__instance, "add_session_log", fw.add_session_log)
        return SummaryWriter.__instance 
开发者ID:zhaocq-nlp,项目名称:NJUNMT-tf,代码行数:21,代码来源:summary_writer.py

示例2: get

# 需要导入模块: from tensorflow.python.summary.writer import writer [as 别名]
# 或者: from tensorflow.python.summary.writer.writer import FileWriter [as 别名]
def get(logdir):
    """Returns the FileWriter for the specified directory.

    Args:
      logdir: str, name of the directory.

    Returns:
      A `FileWriter`.
    """
    with FileWriterCache._lock:
      if logdir not in FileWriterCache._cache:
        FileWriterCache._cache[logdir] = FileWriter(
            logdir, graph=ops.get_default_graph())
      return FileWriterCache._cache[logdir] 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:16,代码来源:writer_cache.py

示例3: install

# 需要导入模块: from tensorflow.python.summary.writer import writer [as 别名]
# 或者: from tensorflow.python.summary.writer.writer import FileWriter [as 别名]
def install(cls):
    if cls._replaced_summary_writer:
      raise ValueError('FakeSummaryWriter already installed.')
    cls._replaced_summary_writer = writer.FileWriter
    writer.FileWriter = FakeSummaryWriter
    writer_cache.FileWriter = FakeSummaryWriter 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:8,代码来源:fake_summary_writer.py

示例4: uninstall

# 需要导入模块: from tensorflow.python.summary.writer import writer [as 别名]
# 或者: from tensorflow.python.summary.writer.writer import FileWriter [as 别名]
def uninstall(cls):
    if not cls._replaced_summary_writer:
      raise ValueError('FakeSummaryWriter not installed.')
    writer.FileWriter = cls._replaced_summary_writer
    writer_cache.FileWriter = cls._replaced_summary_writer
    cls._replaced_summary_writer = None 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:8,代码来源:fake_summary_writer.py

示例5: get

# 需要导入模块: from tensorflow.python.summary.writer import writer [as 别名]
# 或者: from tensorflow.python.summary.writer.writer import FileWriter [as 别名]
def get(logdir):
    """Returns the SummaryWriter for the specified directory.

    Args:
      logdir: str, name of the directory.

    Returns:
      A `SummaryWriter`.
    """
    with SummaryWriterCache._lock:
      if logdir not in SummaryWriterCache._cache:
        SummaryWriterCache._cache[logdir] = SummaryWriter(
            logdir, graph=ops.get_default_graph())
      return SummaryWriterCache._cache[logdir] 
开发者ID:tobegit3hub,项目名称:deep_image_model,代码行数:16,代码来源:writer_cache.py


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