diff --git a/tensorflow/core/api_def/base_api/api_def_RGBToHSV.pbtxt b/tensorflow/core/api_def/base_api/api_def_RGBToHSV.pbtxt index 08629610ed4..3c41bb697f2 100644 --- a/tensorflow/core/api_def/base_api/api_def_RGBToHSV.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_RGBToHSV.pbtxt @@ -21,5 +21,17 @@ are in `[0,1]`. `output[..., 0]` contains hue, `output[..., 1]` contains saturation, and `output[..., 2]` contains value. All HSV values are in `[0,1]`. A hue of 0 corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue. + +Usage Example: + +>>> blue_image = tf.stack([ +... tf.zeros([5,5]), +... tf.zeros([5,5]), +... tf.ones([5,5])], +... axis=-1) +>>> blue_hsv_image = tf.image.rgb_to_hsv(blue_image) +>>> blue_hsv_image[0,0].numpy() +array([0.6666667, 1. , 1. ], dtype=float32) + END } diff --git a/tensorflow/python/ops/image_grad.py b/tensorflow/python/ops/image_grad.py index 878ca4d8513..8deac46aa06 100644 --- a/tensorflow/python/ops/image_grad.py +++ b/tensorflow/python/ops/image_grad.py @@ -177,17 +177,6 @@ def _RGBToHSVGrad(op, grad): separately before adding them in the end. Formulas are given before each partial derivative calculation. - Usage Example: - - >>> rgb_image = tf.stack([ - ... tf.zeros([5,5]), - ... tf.zeros([5,5]), - ... tf.ones([5,5])], - ... axis=-1) - >>> hsv_image = tf.image.rgb_to_hsv(rgb_image) - >>> hsv_image[1,1].numpy() - array([0.6666667, 1. , 1. ], dtype=float32) - Args: op: The `rgb_to_hsv` `Operation` that we are differentiating. grad: Gradient with respect to the output of the `rgb_to_hsv` op.