code: def lrn_helper(
      dtype,
      ones,
      cpu,
      alpha,
      beta,
      ascale,
      bpower,
      ng,
      nc,
      layer_g,
      layer_c,
      N,
      C,
      D,
      H,
      W,
      J,
  ):
      dimI = layer_g.dimI
      dimO = layer_g.dimO
  
      # cpu input arrays
      # Note that we truncte these to 16 bits so that the cpu and gpu
      # will agree on an index if there is a tie.
      if ones:
          cpuI = np.ones(slicable(dimI), dtype=np.float32)
          cpuB = np.ones(slicable(dimI), dtype=np.float32)
          cpuE = np.ones(dimO, dtype=np.float32)
          cpuO = np.ones(dimO, dtype=np.float32)
      else:
          cpuI = (
              np.random.uniform(-1.0, 1.0, slicable(dimI))
              .astype(np.float16)
              .astype(np.float32)
          )
          cpuB = (
              np.random.uniform(-1.0, 1.0, slicable(dimI))
              .astype(np.float16)
              .astype(np.float32)
          )
          cpuE = (
              np.random.uniform(-1.0, 1.0, dimO)
              .astype(np.float16)
              .astype(np.float32)
          )
          cpuO = (
              np.random.uniform(-1.0, 1.0, dimO)
              .astype(np.float16)
              .astype(np.float32)
          )
  
      # give gpu the input array without zero padding (not needed)
      devI = ng.array(cpuI.reshape(dimI), dtype=dtype)
      devB = ng.array(
          cpuB.reshape(dimI), dtype=dtype
      )  # delta "backprop"
      devE = ng.array(cpuE, dtype=dtype)
      devO = ng.array(cpuO, dtype=dtype)
      devD = ng.empty(dimO, dtype=dtype)  # denom
  
      cccI = nc.array(cpuI.reshape(dimI), dtype=dtype)
      cccB = nc.array(
          cpuB.reshape(dimI), dtype=dtype
      )  # delta "backprop"
      cccE = nc.array(cpuE, dtype=dtype)
      cccO = nc.array(cpuO, dtype=dtype)
      cccD = nc.empty(dimO, dtype=dtype)  # denom
  
      # layer, I, O, denom, ascale=1, bpower=1
      ng.fprop_lrn(
          layer_g, devI, devO, devD, alpha, beta, ascale, bpower
      )  # I, O, denom
      nc.fprop_lrn(
          layer_c, cccI, cccO, cccD, None, None, ascale, bpower
      )  # CPU has no alpha, beta
  
      neon_logger.display("== denom ==")
      neon_logger.display("CPU fprop")
      neon_logger.display(
          cccD.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
      neon_logger.display("GPU fprop")
      neon_logger.display(
          devD.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
  
      neon_logger.display("== output ==")
      neon_logger.display("CPU fprop")
      neon_logger.display(
          cccO.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
      neon_logger.display("GPU fprop")
      neon_logger.display(
          devO.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
  
      # I, O, E, delta, denom
      ng.bprop_lrn(
          layer_g,
          devI,
          devO,
          devE,
          devB,
          devD,
          alpha,
          beta,
          ascale,
          bpower,
      )
      nc.bprop_lrn(
          layer_c,
          cccI,
          cccO,
          cccE,
          cccB,
          cccD,
          None,
          None,
          ascale,
          bpower,
      )
  
      neon_logger.display("== bprop ==")
      neon_logger.display("CPU bprop")
      neon_logger.display(
          cccB.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
      neon_logger.display("GPU bprop")
      neon_logger.display(
          devB.get().reshape(C * D * H * W, N)[0:4, 0:4]
      )
  
file_path: neon/tests/test_backend_lrn.py
imports: import numpy
  import pytest
  from neon import logger
label_desc: Use image node_id 5 for calling a global function with example usage: lrn_helper(dtype, ones, cpu, alpha, beta, ascale, bpower, ng, nc, layer_g, layer_c, N, C, D, H, W, J) without return types