var (
// ErrInvalidImageTensor occurs when the tensor does not exhibit the// structure or appearance of an image.
ErrInvalidImageTensor = errors.New("invalid image tensor")
)
TensorToImage converts a tf.Tensor into an image.Image. It
determines the type of image (RGB vs Gray) and returns an
error if the Tensor is not a valid image.