def _make_image(tensor):
assert isinstance(tensor, NDArray)<EOL>if Image is None:<EOL><INDENT>raise ImportError('<STR_LIT>')<EOL><DEDENT>height, width, channel = tensor.shape<EOL>tensor = _make_numpy_array(tensor)<EOL>image = Image.fromarray(tensor)<EOL>output = io.BytesIO()<EOL>image.save(output, format='<STR_LIT>')<EOL>image_string = output.getvalue()<EOL>output.close()<EOL>return Summary.Image(height=height, width=width, colorspace=channel,<EOL>encoded_image_string=image_string)<EOL>
Converts an NDArray type image to Image protobuf