original_docstring: Map MXNet's Pooling operator attributes to onnx's
      MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators
      based on the input node's attributes and return the created node.
      
docstring: Map MXNet's Pooling operator attributes to onnx's
  MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators
  based on the input node's attributes and return the created node.
docstring_tokens: Map MXNet ' s Pooling operator attributes to onnx ' s MaxPool / AveragePool / GlobalMaxPool / GlobalAveragePool operators based on the input node ' s attributes and return the created node .
code: def convert_pooling(node, **kwargs):
      """Map MXNet's Pooling operator attributes to onnx's
      MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators
      based on the input node's attributes and return the created node.
      """
      onnx = import_onnx_modules()
      proc_nodes = kwargs["proc_nodes"]
      attrs = node["attrs"]
      kernel = eval(attrs["kernel"])
      pool_type = attrs["pool_type"]
      stride = eval(attrs["stride"]) if attrs.get("stride") else None
      global_pool = get_boolean_attribute_value(attrs, "global_pool")
  
      node_inputs = node["inputs"]
      input_node_idx = kwargs["index_lookup"][node_inputs[0][0]]
      input_node = proc_nodes[input_node_idx]
      name = node["name"]
  
      pooling_convention = attrs.get('pooling_convention', 'valid')
  
      if pooling_convention == 'full':
          pooling_warning = "Pooling: ONNX currently doesn't support pooling_convention. " \
                            "This might lead to shape or accuracy issues. " \
                            "https://github.com/onnx/onnx/issues/549"
  
          logging.warning(pooling_warning)
  
      pad_dims = list(parse_helper(attrs, "pad", [0, 0]))
      pad_dims = pad_dims + pad_dims
      pool_types = {"max": "MaxPool", "avg": "AveragePool"}
      global_pool_types = {"max": "GlobalMaxPool", "avg": "GlobalAveragePool"}
  
      if global_pool:
          node = onnx.helper.make_node(
              global_pool_types[pool_type],
              [input_node.name],  # input
              [name],
              name=name
          )
      else:
          node = onnx.helper.make_node(
              pool_types[pool_type],
              [input_node.name],  # input
              [name],
              kernel_shape=kernel,
              pads=pad_dims,
              strides=stride,
              name=name
          )
  
      return [node]
code_tokens: def convert_pooling ( node , ** kwargs ) : onnx = import_onnx_modules ( ) proc_nodes = kwargs [ "proc_nodes" ] attrs = node [ "attrs" ] kernel = eval ( attrs [ "kernel" ] ) pool_type = attrs [ "pool_type" ] stride = eval ( attrs [ "stride" ] ) if attrs . get ( "stride" ) else None global_pool = get_boolean_attribute_value ( attrs , "global_pool" ) node_inputs = node [ "inputs" ] input_node_idx = kwargs [ "index_lookup" ] [ node_inputs [ 0 ] [ 0 ] ] input_node = proc_nodes [ input_node_idx ] name = node [ "name" ] pooling_convention = attrs . get ( 'pooling_convention' , 'valid' ) if pooling_convention == 'full' : pooling_warning = "Pooling: ONNX currently doesn't support pooling_convention. " "This might lead to shape or accuracy issues. " "https://github.com/onnx/onnx/issues/549" logging . warning ( pooling_warning ) pad_dims = list ( parse_helper ( attrs , "pad" , [ 0 , 0 ] ) ) pad_dims = pad_dims + pad_dims pool_types = { "max" : "MaxPool" , "avg" : "AveragePool" } global_pool_types = { "max" : "GlobalMaxPool" , "avg" : "GlobalAveragePool" } if global_pool : node = onnx . helper . make_node ( global_pool_types [ pool_type ] , [ input_node . name ] , [ name ] , name = name ) else : node = onnx . helper . make_node ( pool_types [ pool_type ] , [ input_node . name ] , [ name ] , kernel_shape = kernel , pads = pad_dims , strides = stride , name = name ) return [ node ]
short_docstring: Map MXNet's Pooling operator attributes to onnx's
  MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators
  based on the input node's attributes and return the created node.
short_docstring_tokens: Map MXNet ' s Pooling operator attributes to onnx ' s MaxPool / AveragePool / GlobalMaxPool / GlobalAveragePool operators based on the input node ' s attributes and return the created node .
comment: """Map MXNet's Pooling operator attributes to onnx's
      MaxPool/AveragePool/GlobalMaxPool/GlobalAveragePool operators
      based on the input node's attributes and return the created node.
      """$SEP$# input$SEP$# input