code: def convert_npi_mean(node, **kwargs):
      """Map MXNet's mean operator attributes to onnx's ReduceMean operator
      and return the created node.
      """
      from onnx.helper import make_node
  
      name, input_nodes, attrs = get_inputs(node, kwargs)
  
      dtype = np.dtype("float32")
      dtype_t = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[dtype]
  
      mx_axis = str(attrs.get("axis", "None"))
      axes = (
          convert_string_to_list(mx_axis) if mx_axis != "None" else None
      )
  
      keepdims = get_boolean_attribute_value(attrs, "keepdims")
  
      if axes is not None:
          create_tensor(axes, name + "_axes", kwargs["initializer"])
          if keepdims:
              nodes = [
                  make_node(
                      "Cast", input_nodes, [name + "_cast"], to=dtype_t
                  ),
                  make_node(
                      "ReduceMean",
                      [name + "_cast"],
                      [name],
                      axes=axes,
                      keepdims=keepdims,
                  ),
              ]
          else:
              create_tensor([1], name + "_1", kwargs["initializer"])
              create_tensor([0], name + "_0", kwargs["initializer"])
              nodes = [
                  make_node(
                      "Cast", input_nodes, [name + "_cast"], to=dtype_t
                  ),
                  make_node(
                      "ReduceMean",
                      [name + "_cast"],
                      [name + "_reduce"],
                      axes=axes,
                      keepdims=keepdims,
                  ),
                  make_node(
                      "Shape",
                      [name + "_reduce"],
                      [name + "_reduce_shape"],
                  ),
                  make_node(
                      "Concat",
                      [name + "_1", name + "_reduce_shape"],
                      [name + "_concat"],
                      axis=0,
                  ),
                  make_node(
                      "Reshape",
                      [name + "_reduce", name + "_concat"],
                      [name + "_reshape"],
                  ),
                  make_node(
                      "Squeeze",
                      [name + "_reshape", name + "_0"],
                      [name],
                  ),
              ]
      else:
          if keepdims:
              nodes = [
                  make_node(
                      "Cast", input_nodes, [name + "_cast"], to=dtype_t
                  ),
                  make_node(
                      "ReduceMean",
                      [name + "_cast"],
                      [name],
                      keepdims=keepdims,
                  ),
              ]
          else:
              create_tensor([1], name + "_1", kwargs["initializer"])
              nodes = [
                  make_node(
                      "Cast", input_nodes, [name + "_cast"], to=dtype_t
                  ),
                  make_node(
                      "ReduceMean",
                      [name + "_cast"],
                      [name],
                      keepdims=keepdims,
                  ),
              ]
      return nodes, (dtype,)
  
imports: import re
  import logging
  import numpy
  from .._export_onnx import MXNetGraph
label_desc: Use image node_id 36 for calling a global function with example usage: convert_npi_mean(node) and returns: nodes,  dtype