class_docstr: A class for convert megengine dumped model to mace model.
class_docstr_tok: ["A","class","for","convert","megengine","dumped","model","to","mace","model","."]
code: def __init__(self, option, src_model_file):
      self._op_converters = {
          MGEOpType.AxisAddRemove.name: self.convert_axisaddrm,
          MGEOpType.BatchNormForward.name: self.convert_batchnorm,
          MGEOpType.Concat.name: self.convert_concat,
          MGEOpType.ConvolutionForward.name: self.convert_conv2d,
          MGEOpType.ConvolutionBackwardData.name: self.convert_deconv2d,
          MGEOpType.Dimshuffle.name: self.convert_dimshuffle,
          MGEOpType.Elemwise.name: self.convert_elemwise,
          MGEOpType.GetVarShape.name: self.convert_shape,
          MGEOpType.Host2DeviceCopy.name: self.convert_nop,
          MGEOpType.Identity.name: self.convert_identity,
          MGEOpType.MarkNoBroadcastElemwise.name: self.convert_identity,
          MGEOpType.MatrixMul.name: self.convert_matmul,
          MGEOpType.PoolingForward.name: self.convert_pooling,
          MGEOpType.Reduce.name: self.convert_reduce,
          MGEOpType.Reshape.name: self.convert_reshape,
          MGEOpType.SharedDeviceTensor.name: self.convert_nop,
          MGEOpType.Subtensor.name: self.convert_subtensor,
      }
      self._option = option
      self._converter_info = dict()
      self._mace_net_def = mace_pb2.NetDef()
      ConverterUtil.set_filter_format(
          self._mace_net_def, DataFormat.OIHW
      )
      ConverterUtil.add_data_format_arg(
          self._mace_net_def, DataFormat.NCHW
      )
  
      cg, _, outputs = mgb.load_comp_graph_from_file(src_model_file)
      map_oprs, _, var2oprs, *_ = mgb.cgtools.graph_traversal(outputs)
      # prune second input of reshape
      # because it introduces several ops, may increase the overhead
      operators = mgb.cgtools.get_oprs_seq(outputs, prune_reshape=True)
  
      self._mge_cg = cg
      self._mge_operators = operators
      self._mge_map_oprs = map_oprs
      self._mge_var2oprs = var2oprs
  
      self._skip_tensors = set()
      self._bn_statistis_tensors = {}
  
imports: import os
  import math
  import numpy
  import six
  import megengine._internal
  from enum import Enum
  from py_proto import mace_pb2
  from transform import base_converter
  from transform.base_converter import PoolingType
  from transform.base_converter import ActivationType
  from transform.base_converter import EltwiseType
  from transform.base_converter import FrameworkType
  from transform.base_converter import ReduceType
  from transform.base_converter import DataFormat
  from transform.base_converter import MaceOp
  from transform.base_converter import MaceKeyword
  from transform.base_converter import ConverterUtil
  from transform.base_converter import RoundMode
  from utils.util import mace_check
label_desc: Use image node_id 1 to create a new MegengineConverter object from inherited base classes: base_converter with example: obj = MegengineConverter(option, src_model_file)