code: def forward(self, inputs):
      xp = backend.get_array_module(*inputs)
      pred, true = inputs
      SS_res = xp.asarray(xp.sum((pred - true) ** 2, axis=0))
      SS_tot = xp.asarray(
          xp.sum((true - xp.mean(true, axis=0)) ** 2, axis=0)
      )
      SS_tot_iszero = SS_tot == 0
      SS_tot[
          SS_tot_iszero
      ] = 1  # Assign dummy value to avoid zero-division
      ret = xp.where(SS_tot_iszero, 0.0, 1 - SS_res / SS_tot).astype(
          pred.dtype, copy=False
      )
      if self.multioutput == "uniform_average":
          return (xp.asarray(ret.mean()),)
      elif self.multioutput == "raw_values":
          return (ret,)
  
file_path: chainer/chainer/functions/evaluation/r2_score.py
imports: from chainer import backend
  from chainer import function
  from chainer.utils import type_check
label_desc: Use image node_id 3 for calling the R2_score obj's underlying member method code with example usage: obj.forward(inputs) and returns: xp, ret