code: def _cu_conv_sum(y, x, n):
      # Convolutional sum
      # TODO(beam2d): Use scan computation
      rdim = x.size // (x.shape[0] * x.shape[1])
      cuda.elementwise(
          "raw T x, int32 rdim, int32 N, int32 n_",
          "raw T y",
          """
            int half_n = n_ / 2;
            int offset = i / rdim * N * rdim + i % rdim;
  
            float sum_part = 0;
            for (int j = 0; j < N + half_n; ++j) {
              if (j < N) {
                sum_part += x[offset + j * rdim];
              }
              if (j >= n_) {
                sum_part -= x[offset + (j - n_) * rdim];
              }
              if (j >= half_n) {
                y[offset + (j - half_n) * rdim] = sum_part;
              }
            }
          """,
          "lrn_conv_sum",
      )(x, rdim, x.shape[1], n, y, size=x.shape[0] * rdim)
  
imports: import numpy
  import six
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: _cu_conv_sum(y, x, n) without return types