code: def _tensor_from_array_for_constant(array, name):
      tensor = numpy_helper.from_array(array, name=name)
      # Avoid `raw_data` for better debuggability. This would be OK
      # since constants are usually small.
      field_name = onnx.mapping.STORAGE_TENSOR_TYPE_TO_FIELD.get(
          tensor.data_type, None
      )
      if field_name is not None:
          tensor.ClearField("raw_data")
          getattr(tensor, field_name)[:] = array.flatten().tolist()
      return tensor
  
file_path: chainer/onnx_chainer/context.py
imports: import chainer
  import onnx
  from onnx import numpy_helper
  from onnx_chainer import onnx_helper
label_desc: Use image node_id 1 for calling a global function with example usage: _tensor_from_array_for_constant(array, name) and returns: tensor