From c1e7b1580a48c06a7345fe8ff218feafa56a1425 Mon Sep 17 00:00:00 2001 From: Makoto Uchida Date: Wed, 21 Dec 2016 20:06:34 -0800 Subject: [PATCH] Fixing typo in doc string, and improve documentation. Change: 142727588 --- .../slim/python/slim/data/tfexample_decoder.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py b/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py index bf6f14e8f5d..e623433fef5 100644 --- a/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py +++ b/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py @@ -273,9 +273,10 @@ class Image(ItemHandler): is stored. format_key: the name of the TF-Example feature in which the image format is stored. - shape: the output shape of the image. If provided, the image is reshaped - accordingly. If left as None, no reshaping is done. A shape should be - supplied only if all the stored images have the same shape. + shape: the output shape of the image as 1-D `Tensor` + [height, width, channels]. If provided, the image is reshaped + accordingly. If left as None, no reshaping is done. A shape should + be supplied only if all the stored images have the same shape. channels: the number of channels in the image. """ if not image_key: @@ -300,11 +301,12 @@ class Image(ItemHandler): """Decodes the image buffer. Args: - image_buffer: T tensor representing the encoded image tensor. + image_buffer: The tensor representing the encoded image tensor. image_format: The image format for the image in `image_buffer`. Returns: - A decoder image. + A tensor that represents decoded image of self._shape, or + (?, ?, self._channels) if self._shape is not specified. """ def decode_png(): return image_ops.decode_png(image_buffer, self._channels) @@ -329,7 +331,8 @@ class Image(ItemHandler): } default_decoder = decode_jpg - image = control_flow_ops.case(pred_fn_pairs, default=default_decoder, exclusive=True) + image = control_flow_ops.case( + pred_fn_pairs, default=default_decoder, exclusive=True) image.set_shape([None, None, self._channels]) if self._shape is not None: