MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / add_image_summary

Function add_image_summary

tensorflow/contrib/slim/python/slim/summaries.py:79–102  ·  view source on GitHub ↗

Adds an image summary for the given tensor. Args: tensor: a variable or op tensor with shape [batch,height,width,channels] name: the optional name for the summary. prefix: An optional prefix for the summary names. print_summary: If `True`, the summary is printed to stdout when the

(tensor, name=None, prefix=None, print_summary=False)

Source from the content-addressed store, hash-verified

77
78
79def add_image_summary(tensor, name=None, prefix=None, print_summary=False):
80 """Adds an image summary for the given tensor.
81
82 Args:
83 tensor: a variable or op tensor with shape [batch,height,width,channels]
84 name: the optional name for the summary.
85 prefix: An optional prefix for the summary names.
86 print_summary: If `True`, the summary is printed to stdout when the summary
87 is computed.
88
89 Returns:
90 An image `Tensor` of type `string` whose contents are the serialized
91 `Summary` protocol buffer.
92 """
93 summary_name = _get_summary_name(tensor, name, prefix)
94 # If print_summary, then we need to make sure that this call doesn't add the
95 # non-printing op to the collection. We'll add it to the collection later.
96 collections = [] if print_summary else None
97 op = summary.image(
98 name=summary_name, tensor=tensor, collections=collections)
99 if print_summary:
100 op = logging_ops.Print(op, [tensor], summary_name)
101 ops.add_to_collection(ops.GraphKeys.SUMMARIES, op)
102 return op
103
104
105def add_scalar_summary(tensor, name=None, prefix=None, print_summary=False):

Callers 1

add_image_summariesFunction · 0.85

Calls 3

_get_summary_nameFunction · 0.85
add_to_collectionMethod · 0.80
PrintMethod · 0.45

Tested by

no test coverage detected