Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the
appropriate operation to convert the input bytes string into a Tensor of type
A Tensor of type string. 0-D. The encoded image bytes.
An optional int. Defaults to 0.
Number of color channels for the decoded image.
An optional tf.DType from: tf.uint8, tf.uint16, tf.float32. Defaults to tf.uint8.
The desired DType of the returned Tensor.
An optional bool. Defaults to True.
Controls the output shape of the returned op. If True, the returned op will
produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all
GIFs, whether animated or not. If, False, the returned op will produce a 3-D
tensor for all file types and will truncate animated GIFs to the first frame.