當前位置: 首頁>>代碼示例>>Python>>正文


Python summary_pb2.SummaryDescription方法代碼示例

本文整理匯總了Python中tensorflow.core.framework.summary_pb2.SummaryDescription方法的典型用法代碼示例。如果您正苦於以下問題:Python summary_pb2.SummaryDescription方法的具體用法?Python summary_pb2.SummaryDescription怎麽用?Python summary_pb2.SummaryDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorflow.core.framework.summary_pb2的用法示例。


在下文中一共展示了summary_pb2.SummaryDescription方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_summary_description

# 需要導入模塊: from tensorflow.core.framework import summary_pb2 [as 別名]
# 或者: from tensorflow.core.framework.summary_pb2 import SummaryDescription [as 別名]
def get_summary_description(node_def):
  """Given a TensorSummary node_def, retrieve its SummaryDescription.

  When a Summary op is instantiated, a SummaryDescription of associated
  metadata is stored in its NodeDef. This method retrieves the description.

  Args:
    node_def: the node_def_pb2.NodeDef of a TensorSummary op

  Returns:
    a summary_pb2.SummaryDescription

  Raises:
    ValueError: if the node is not a summary op.
  """

  if node_def.op != 'TensorSummary':
    raise ValueError("Can't get_summary_description on %s" % node_def.op)
  description_str = _compat.as_str_any(node_def.attr['description'].s)
  summary_description = SummaryDescription()
  _json_format.Parse(description_str, summary_description)
  return summary_description 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:24,代碼來源:summary.py

示例2: tensor_summary

# 需要導入模塊: from tensorflow.core.framework import summary_pb2 [as 別名]
# 或者: from tensorflow.core.framework.summary_pb2 import SummaryDescription [as 別名]
def tensor_summary(  # pylint: disable=invalid-name
    name,
    tensor,
    summary_description=None,
    collections=None):
  # pylint: disable=line-too-long
  """Outputs a `Summary` protocol buffer with a serialized tensor.proto.

  The generated
  [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
  has one summary value containing the input tensor.

  Args:
    name: A name for the generated node. Will also serve as the series name in
      TensorBoard.
    tensor: A tensor of any type and shape to serialize.
    summary_description: Optional summary_pb2.SummaryDescription()
    collections: Optional list of graph collections keys. The new summary op is
      added to these collections. Defaults to `[GraphKeys.SUMMARIES]`.

  Returns:
    A scalar `Tensor` of type `string`. The serialized `Summary` protocol
    buffer.
  """
  # pylint: enable=line-too-long

  if summary_description is None:
    summary_description = summary_pb2.SummaryDescription()

  description = json_format.MessageToJson(summary_description)
  with ops.name_scope(name, None, [tensor]) as scope:
    val = gen_logging_ops._tensor_summary(
        tensor=tensor,
        description=description,
        name=scope)
    _Collect(val, collections, [ops.GraphKeys.SUMMARIES])
  return val 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:39,代碼來源:summary_ops.py


注:本文中的tensorflow.core.framework.summary_pb2.SummaryDescription方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。