message: TST: add benchmark
diff: @@ -25,6 +25,8 @@ from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import random_seed as random_seed_lib
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker
  +from tensorflow.python.ops import gradients_impl
  +from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import test
  @@ -100,6 +102,24 @@ class ExtractImagePatchesGradTest(test.TestCase):
  print('extract_image_patches gradient err: %.4e' % err)
  self.assertLess(err, 1e-4)
  + def testConstructGradientWithLargeImages(self):
  + batch_size = 4
  + height = 1024
  + width = 1024
  + ksize = 5
  + images = variable_scope.get_variable('inputs',
  + (batch_size, height, width, 1))
  + patches = array_ops.extract_image_patches(images,
  + ksizes=[1, ksize, ksize, 1],
  + strides=[1, 1, 1, 1],
  + rates=[1, 1, 1, 1],
  + padding='SAME')
  + # Github issue: #20146
  + # tf.extract_image_patches() gradient very slow at graph construction time
  + gradients = gradients_impl.gradients(patches, images)
  + # Won't time out.
  + self.assertIsNotNone(gradients)
  +
  if __name__ == '__main__':
  test.main()
  