code: def test_local_response_normalization(device_id, precision):
      dtype = PRECISION_TO_TYPE[precision]
      dev = cntk_device(device_id)
  
      def lrn(x, depth_radius, bias, alpha, beta, name=""):
          x2 = C.square(x)
          # reshape to insert a fake singleton reduction dimension after the 3th axis (channel axis). Note Python axis order and BrainScript are reversed.
          x2s = C.reshape(x2, (1, C.InferredDimension), 0, 1)
          W = C.constant(
              alpha / (2 * depth_radius + 1),
              shape=(1, 2 * depth_radius + 1, 1, 1),
              dtype=dtype,
              name="W",
          )
          # 3D convolution with a filter that has a non 1-size only in the 3rd axis, and does not reduce since the reduction dimension is fake and 1
          y = C.convolution(W, x2s)
          # reshape back to remove the fake singleton reduction dimension
          b = C.reshape(y, C.InferredDimension, 0, 2)
          den = C.exp(beta * C.log(bias + b))
          return C.element_divide(x, den)
  
      from cntk import local_response_normalization
  
      img_shape = (64, 32, 32)
      img = np.asarray(np.random.uniform(-1, 1, img_shape), dtype=dtype)
      x_gt = C.input_variable(shape=img_shape, dtype=dtype)
      x_r = C.input_variable(shape=img_shape, dtype=dtype)
  
      gt = lrn(x_gt, 2, 1.0, 0.0001, 0.75)
      r = local_response_normalization(x_r, 2, 1.0, 0.0001, 0.75)
      ss = gt.eval({x_gt: img})
      sa = r.eval({x_r: img})
  
      assert np.allclose(r.eval({x_r: img}), gt.eval({x_gt: img}))
  
imports: from __future__ import division
  import numpy
  import cntk
  import pytest
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  from cntk.tests.test_utils import TOLERANCE_ABSOLUTE
  from cntk.internal.utils import eval
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
  from cntk.variables import Parameter, Constant
label_desc: Use image node_id 30 for calling a global function with example usage: test_local_response_normalization(device_id, precision) and returns: C