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 add_stride_pad_kernel_arg(params, op_def):
      stride = [params[mge_stride_h_str], params[mge_stride_w_str]]
      pad = [params[mge_pad_h_str] * 2, params[mge_pad_w_str] * 2]
  
      strides_arg = op_def.arg.add()
      strides_arg.name = MaceKeyword.mace_strides_str
      strides_arg.ints.extend(stride)
      padding_arg = op_def.arg.add()
      padding_arg.name = MaceKeyword.mace_padding_values_str
      padding_arg.ints.extend(pad)
  
      if op_def.type == MaceOp.Pooling.name:
          kernel = [params[mge_kernel_h_str], params[mge_kernel_w_str]]
          kernels_arg = op_def.arg.add()
          kernels_arg.name = MaceKeyword.mace_kernel_str
          kernels_arg.ints.extend(kernel)
      if op_def.type in (
          MaceOp.Conv2D.name,
          MaceOp.DepthwiseConv2d.name,
          MaceOp.Deconv2D.name,
          MaceOp.DepthwiseDeconv2d.name,
      ):
          dilation = [
              params[mge_dilate_h_str],
              params[mge_dilate_w_str],
          ]
          dilation_arg = op_def.arg.add()
          dilation_arg.name = MaceKeyword.mace_dilations_str
          dilation_arg.ints.extend(dilation)
  
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 4 for calling the MegengineConverter obj's underlying member method code with example usage: obj.add_stride_pad_kernel_arg(params, op_def) without return types