code: def convert_Unpooling2D(
      func, opset_version, input_names, output_names, context
  ):
      pad = [func.ph, func.pw]
      stride = [func.sy, func.sx]
      ksize = [func.kh, func.kw]
      outsize = [func.outh, func.outw]
      # TODO(hamaji): These could be implemented by `Slice` and `Pad`.
      h, w = func.inputs[0].shape[2:]
      expected_outsize = [
          conv.get_deconv_outsize(
              h, func.kh, func.sy, func.ph, cover_all=func.cover_all
          ),
          conv.get_deconv_outsize(
              w, func.kw, func.sx, func.pw, cover_all=func.cover_all
          ),
      ]
      if outsize != expected_outsize:
          raise RuntimeError(
              "ONNX-chainer does not support `outsize!=None` "
              "for Unpooling2D: expected={} actual={}".format(
                  expected_outsize, outsize
              )
          )
      if pad != [0, 0]:
          raise RuntimeError(
              "ONNX-chainer does not support `pad!=0` "
              "for Unpooling2D"
          )
      # This one would require an extra 1x1 MaxPool.
      if stride != ksize:
          raise RuntimeError(
              "ONNX-chainer does not support `stride!=ksize` "
              "for Unpooling2D: stride={} ksize={}".format(
                  stride, ksize
              )
          )
  
      if func.cover_all:
          uncovered_outsize = [
              conv.get_deconv_outsize(
                  h, func.kh, func.sy, func.ph, cover_all=False
              ),
              conv.get_deconv_outsize(
                  w, func.kw, func.sx, func.pw, cover_all=False
              ),
          ]
          scales = [
              1.0,
              1.0,
              func.kh * outsize[0] / uncovered_outsize[0],
              func.kw * outsize[1] / uncovered_outsize[1],
          ]
      else:
          scales = [1.0, 1.0, float(func.kh), float(func.kw)]
      if opset_version == 7:
          return (
              onnx_helper.make_node(
                  "Upsample", input_names, output_names, scales=scales
              ),
          )
      scales_name = context.add_const(
          np.array(scales, dtype=np.float32), "scales"
      )
      if opset_version in [9, 10]:
          input_names.append(scales_name)
          op = "Upsample" if opset_version == 9 else "Resize"
          return (onnx_helper.make_node(op, input_names, output_names),)
      if opset_version == 11:
          roi_name = context.add_const(np.array([]), "roi")
          input_names.extend([roi_name, scales_name])
          return (
              onnx_helper.make_node(
                  "Resize", input_names, output_names
              ),
          )
  
file_path: chainer/onnx_chainer/functions/pooling.py
imports: import warnings
  from chainer.utils import conv
  import numpy
  from onnx_chainer.functions.opset_version import support
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 6 for calling a global function with example usage: convert_Unpooling2D(func, opset_version, input_names, output_names, context) and returns: onnx_helper, onnx_helper, onnx_helper