docstr: Convert ReduceMean layer to coreml.
docstr_tok: ["Convert","ReduceMean","layer","to","coreml","."]
code: def emit_ReduceMean(self, IR_node):
      """
      Convert ReduceMean layer to coreml.
      """
  
      axis = IR_node.get_attr("axes", [1, 2])
  
      #       Allowed values: 'CHW', 'HW', 'C', 'H', 'W'
      if len(axis) == 1:
          if axis[0] == 0:
              axis_str = "C"
          elif axis[0] == 1:
              axis_str = "H"
          elif axis[0] == 2:
              axis_str = "W"
      elif len(axis) == 2:
          axis_str = "HW"
      elif len(axis) == 3:
          axis_str = "CHW"
  
      # Get input and output names
      input_name = self.IR_graph.get_node(IR_node.in_edges[0]).real_name
  
      self.builder.add_reduce(
          IR_node.name,
          input_name=input_name,
          output_name=IR_node.name,
          axis=axis_str,
          mode="avg",
          epsilon=1e-6,
      )
  
imports: from __future__ import division
  import os
  import numpy
  from six import string_types
  from mmdnn.conversion.common.IR.IR_graph import IRGraph, IRGraphNode
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
  from mmdnn.conversion.common.DataStructure.emitter import Emitter
  from mmdnn.conversion.common.utils import *
  from mmdnn.conversion.coreml.coreml_utils import _infer_coreml_input_shape
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models import datatypes
  from coremltools.models import MLModel
  from coremltools.models.utils import save_spec
label_desc: Use image node_id 15 for calling the CoreMLEmitter obj's underlying member method code with example usage: obj.emit_ReduceMean(IR_node) without return types