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


Python event_pb2.TaggedRunMetadata方法代码示例

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


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

示例1: add_run_metadata

# 需要导入模块: from tensorflow.core.util import event_pb2 [as 别名]
# 或者: from tensorflow.core.util.event_pb2 import TaggedRunMetadata [as 别名]
def add_run_metadata(self, run_metadata, tag, global_step=None):
    """Adds a metadata information for a single session.run() call.

    Args:
      run_metadata: A `RunMetadata` protobuf object.
      tag: The tag name for this metadata.
      global_step: Number. Optional global step counter to record with the
        StepStats.

    Raises:
      ValueError: If the provided tag was already used for this type of event.
    """
    if tag in self._session_run_tags:
      raise ValueError("The provided tag was already used for this event type")
    self._session_run_tags[tag] = True

    tagged_metadata = event_pb2.TaggedRunMetadata()
    tagged_metadata.tag = tag
    # Store the `RunMetadata` object as bytes in order to have postponed
    # (lazy) deserialization when used later.
    tagged_metadata.run_metadata = run_metadata.SerializeToString()
    event = event_pb2.Event(tagged_run_metadata=tagged_metadata)
    self._add_event(event, global_step) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:25,代码来源:writer.py

示例2: add_run_metadata

# 需要导入模块: from tensorflow.core.util import event_pb2 [as 别名]
# 或者: from tensorflow.core.util.event_pb2 import TaggedRunMetadata [as 别名]
def add_run_metadata(self, run_metadata, tag, global_step=None):
    """Adds a metadata information for a single session.run() call.

    Args:
      run_metadata: A `RunMetadata` protobuf object.
      tag: The tag name for this metadata.
      global_step: Number. Optional global step counter to record with the
        StepStats.

    Raises:
      ValueError: If the provided tag was already used for this type of event.
    """
    if tag in self._session_run_tags:
      raise ValueError("The provided tag was already used for this event type")
    self._session_run_tags[tag] = True

    tagged_metadata = event_pb2.TaggedRunMetadata()
    tagged_metadata.tag = tag
    # Store the `RunMetadata` object as bytes in order to have postponed
    # (lazy) deserialization when used later.
    tagged_metadata.run_metadata = run_metadata.SerializeToString()
    event = event_pb2.Event(wall_time=time.time(),
                            tagged_run_metadata=tagged_metadata)
    if global_step is not None:
      event.step = int(global_step)
    self._event_queue.put(event) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:28,代码来源:summary_iterator.py


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