diff --git a/tensorflow/core/api_def/base_api/api_def_ExtractGlimpse.pbtxt b/tensorflow/core/api_def/base_api/api_def_ExtractGlimpse.pbtxt index c10a1bb778e..0ed7ccad26a 100644 --- a/tensorflow/core/api_def/base_api/api_def_ExtractGlimpse.pbtxt +++ b/tensorflow/core/api_def/base_api/api_def_ExtractGlimpse.pbtxt @@ -48,6 +48,14 @@ END description: <<END indicates if the noise should be generated using a uniform distribution or a Gaussian distribution. +END + } + attr { + name: "noise" + description: <<END +indicates if the noise should `uniform`, `gaussian`, or +`zero`. The default is `` which means the the noise type +will be decided by `uniform_noise`. END } summary: "Extracts a glimpse from the input tensor." diff --git a/tensorflow/core/ops/image_ops_test.cc b/tensorflow/core/ops/image_ops_test.cc index 517af26b44f..e517e750955 100644 --- a/tensorflow/core/ops/image_ops_test.cc +++ b/tensorflow/core/ops/image_ops_test.cc @@ -183,6 +183,13 @@ TEST(ImageOpsTest, ExtractGlimpse_ShapeFn) { op.input_tensors.resize(2); // Inputs are input, size, offsets. + TF_ASSERT_OK(NodeDefBuilder("test", "ExtractGlimpse") + .Input({"input", 0, DT_FLOAT}) + .Input({"size", 1, DT_INT32}) + .Input({"offsets", 2, DT_FLOAT}) + .Attr("uniform_noise", true) + .Attr("noise", "") + .Finalize(&op.node_def)); // Rank and size checks. INFER_ERROR("Shape must be rank 4 but is rank 5", op, "[1,2,3,4,5];?;?");