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)
| 77 | |
| 78 | |
| 79 | def 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 | |
| 105 | def add_scalar_summary(tensor, name=None, prefix=None, print_summary=False): |
no test coverage detected