message: Add benchmarks for LRNGrad
  This commit adds three new benchmarks for the LRNGradOp kernel.  The
  parameters for the benchmarks are taken from the values used in the
  cifar10 and alexnet examples in
diff: @@ -29,6 +29,10 @@ limitations under the License.
  #include "tensorflow/core/lib/random/simple_philox.h"
  #include "tensorflow/core/platform/test.h"
  +#include "tensorflow/core/common_runtime/kernel_benchmark_testlib.h"
  +#include "tensorflow/core/graph/node_builder.h"
  +#include "tensorflow/core/platform/test_benchmark.h"
  +
  namespace tensorflow {
  static const float tol_ = 1e-4;
  @@ -195,4 +199,41 @@ TCASE(T3, 128, 4, 3, 2.0f, 1.0f, 1.0f)
  // clang-format on
  #undef TCASE
  +
  +static Graph* BM_LRNGrad(int batches, int rows, int cols, int depth,
  + int depth_radius) {
  + Graph* g = new Graph(OpRegistry::Global());
  + Tensor grads(DT_FLOAT, TensorShape({batches, rows, cols, depth}));
  + grads.flat<float>().setRandom();
  +
  + Tensor in(DT_FLOAT, TensorShape({batches, rows, cols, depth}));
  + in.flat<float>().setRandom();
  +
  + Tensor out(DT_FLOAT, TensorShape({batches, rows, cols, depth}));
  +
  + Node* ret;
  + TF_CHECK_OK(NodeBuilder(g->NewName("lrn_grad_op"), "LRNGrad")
  + .Input(test::graph::Constant(g, grads))
  + .Input(test::graph::Constant(g, in))
  + .Input(test::graph::Constant(g, out))
  + .Attr("depth_radius", depth_radius)
  + .Attr("bias", 1.0f)
  + .Attr("alpha", 1.0f / 10)
  + .Attr("beta", 2.0f)
  + .Finalize(g, &ret));
  + return g;
  +}
  +
  +#define BM_LRNGradDev(DEVICE, B, R, C, D, DR) \
  + static void BM_LRNGrad_##DEVICE##_##B##_##R##_##C##_##D##_##DR(int iters) { \
  + testing::ItemsProcessed(static_cast<int64>(iters) * B * R * C * D * DR * \
  + 4); \
  + test::Benchmark(#DEVICE, BM_LRNGrad(B, R, C, D, DR)).Run(iters); \
  + } \
  + BENCHMARK(BM_LRNGrad_##DEVICE##_##B##_##R##_##C##_##D##_##DR)
  +
  +BM_LRNGradDev(cpu, 128, 12, 12, 64, 4);
  +BM_LRNGradDev(cpu, 128, 56, 56, 64, 2);
  +BM_LRNGradDev(cpu, 128, 27, 27, 192, 2);
  +
  } // namespace tensorflow
  