code: def convert_parameter(parameter, context):
      if isinstance(parameter, chainer.Parameter):
          array = parameter.array
      elif isinstance(parameter, chainer.Variable):
          array = parameter.array
      elif isinstance(parameter, chainer.get_array_types()):
          array = parameter
      else:
          raise ValueError(
              "The type of parameter is unknown. It should be either Parameter "
              "or Variable or ndarray, but the type was {}.".format(
                  type(parameter)
              )
          )
      array = chainer.cuda.to_cpu(array)
      tensor = numpy_helper.from_array(
          array, context.get_name(parameter)
      )
      return tensor
  
file_path: chainer/onnx_chainer/export.py
imports: from __future__ import print_function
  from collections import OrderedDict
  import warnings
  import chainer
label_desc: Use image node_id 2 for calling a global function with example usage: convert_parameter(parameter, context) and returns: tensor