code: def forward(self, inputs):
      (gy,) = inputs
      xp = backend.get_array_module(gy)
      repeats = self.repeats
      axis = self.axis
      shape = list(self.in_shape)
      dtype = self.in_dtype
  
      if len(gy) == 0:
          gx = xp.zeros(shape, dtype)
          return (gx,)
  
      if len(repeats) == 1:
          repeats = int(repeats[0])
          if axis is None:
              gx = gy.reshape(-1, repeats).sum(axis=1).reshape(shape)
          else:
              shape[axis : axis + 1] = [-1, repeats]
              gx = gy.reshape(shape).sum(axis=axis + 1)
          return (gx,)
  
      if axis is None:
          pos = 0
          gx = xp.zeros(utils.size_of_shape(shape), dtype)
          for i, r in enumerate(repeats):
              gx[i] = xp.sum(gy[pos : pos + r])
              pos += r
          gx = gx.reshape(shape)
      else:
          gx = xp.zeros(shape, dtype)
          pos = 0
          src = [slice(None)] * axis + [None]
          dst = [slice(None)] * axis + [None]
          for i, r in enumerate(repeats):
              src[-1] = slice(pos, pos + r)
              dst[-1] = slice(i, i + 1)
              gx[tuple(dst)] = gy[tuple(src)].sum(
                  axis=axis, keepdims=True
              )
              pos += r
      return (gx,)
  
file_path: chainer/chainer/functions/array/repeat.py
imports: import six
  from chainer import backend
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling the RepeatGrad obj's underlying member method code with example usage: obj.forward(inputs) and returns: gx, gx, gx