code: def _run(self, x, scale, mode=None):  # type: ignore
      if (
          mode == "nearest"
          and scale.astype(np.int64).tolist() == scale.tolist()
      ):
          r = x
          for axis, s in enumerate(scale):
              if s == 1:
                  continue
              r = np.repeat(r, int(s), axis=axis)
          return (r,)
      raise RuntimeError(
          f"Not implemented for mode={mode!r} and scale={scale!r}."
      )
  
imports: import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling the Upsample obj's underlying member method code with example usage: obj._run(x, scale, mode) and returns: r