Writes an image summary if possible.
(name, tensor, bad_color=None, max_images=3, family=None, step=None)
| 802 | |
| 803 | |
| 804 | def image(name, tensor, bad_color=None, max_images=3, family=None, step=None): |
| 805 | """Writes an image summary if possible.""" |
| 806 | |
| 807 | def function(tag, scope): |
| 808 | bad_color_ = (constant_op.constant([255, 0, 0, 255], dtype=dtypes.uint8) |
| 809 | if bad_color is None else bad_color) |
| 810 | # Note the identity to move the tensor to the CPU. |
| 811 | return gen_summary_ops.write_image_summary( |
| 812 | context.context().summary_writer._resource, # pylint: disable=protected-access |
| 813 | _choose_step(step), |
| 814 | tag, |
| 815 | array_ops.identity(tensor), |
| 816 | bad_color_, |
| 817 | max_images, |
| 818 | name=scope) |
| 819 | |
| 820 | return summary_writer_function(name, tensor, function, family=family) |
| 821 | |
| 822 | |
| 823 | def audio(name, tensor, sample_rate, max_outputs, family=None, step=None): |
nothing calls this directly
no test coverage detected