code: def _interpolate(name, dim, interpolate_mode):
      def symbolic_fn(g, input, output_size, *args):
          (
              scales,
              align_corners,
          ) = symbolic_helper._get_interpolate_attributes(
              g, interpolate_mode, args
          )
          symbolic_helper._interpolate_warning(interpolate_mode)
          align_corners = symbolic_helper._maybe_get_scalar(
              align_corners
          )
          if align_corners:
              return symbolic_helper._unimplemented(
                  name, "align_corners == True", input
              )
          output_size = symbolic_helper._maybe_get_const(
              output_size, "is"
          )
          if symbolic_helper._is_value(output_size):
              return symbolic_helper._unimplemented(
                  name, "torch._C.Value (output_size) indexing"
              )
          if scales is None:
              scales = [
                  1.0
                  if i < 2
                  else float(output_size[-(dim - i)])
                  / float(input.type().sizes()[-(dim - i)])
                  for i in range(0, dim)
              ]
          return g.op(
              "Upsample",
              input,
              mode_s=interpolate_mode,
              scales_f=scales,
          )
  
      return symbolic_fn
  
imports: import functools
  import warnings
  import torch
  from torch._C import _onnx
  from torch.onnx import _type_utils, errors, symbolic_helper, symbolic_opset9
  from torch.onnx._internal import jit_utils, registration
label_desc: Use image node_id 2 for calling a global function with example usage: _interpolate(name, dim, interpolate_mode) and returns: symbolic_fn, g, symbolic_helper, symbolic_helper