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 convert_pooling(self, mge_op):
      op = self.convert_general_op(mge_op)
      op.type = MaceOp.Pooling.name
  
      pool_type_arg = op.arg.add()
      pool_type_arg.name = MaceKeyword.mace_pooling_type_str
  
      round_mode_arg = op.arg.add()
      round_mode_arg.name = MaceKeyword.mace_round_mode_str
      round_mode_arg.i = RoundMode.FLOOR.value
  
      # check the case of counting include padding
      mode = mge_op.params["mode"]
      if mode == "AVERAGE_COUNT_EXCLUDE_PADDING" or (
          mode == "AVERAGE"
          and mge_op.params["pad_w"] == 0
          and mge_op.params["pad_h"] == 0
      ):
          pool_type_arg.i = PoolingType.AVG.value
      elif mode == "MAX":
          pool_type_arg.i = PoolingType.MAX.value
      else:
          mace_check(
              False, "AVERAGE pooling should not count padding values"
          )
  
      self.add_stride_pad_kernel_arg(mge_op.params, op)
  
      # delete workspace output, it's useless
      del op.output[1:]
      del op.output_shape[1:]
  
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 17 for calling the MegengineConverter obj's underlying member method code with example usage: obj.convert_pooling(mge_op) without return types