當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。