code: def _convert_pool(node, graph, err):
      node_name = node.name
      input_name = str(node.inputs[0])
      output_name = str(node.outputs[0])
      if node.op_type.endswith("MaxPool"):
          pool_type = P.Pooling.MAX
      elif node.op_type.endswith("AveragePool"):
          pool_type = P.Pooling.AVE
      else:
          return err.unsupported_op_configuration(
              node, "Unsupported pool type"
          )
  
      kernel_shape = node.attrs["kernel_shape"]
      strides = node.attrs.get("strides", [1, 1])
      pads = node.attrs.get("pads", [0, 0, 0, 0])
  
      layer = myf(
          "Pooling",
          node_name,
          [input_name],
          [output_name],
          pooling_param=dict(
              pool=pool_type,
              kernel_h=kernel_shape[0],
              kernel_w=kernel_shape[1],
              stride_h=strides[0],
              stride_w=strides[1],
              pad_h=pads[0],
              pad_w=pads[1],
          ),
      )
      graph.channel_dims[output_name] = graph.channel_dims[input_name]
      return layer
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from caffe import params
  import math
  import numpy
  from ._graph import Node, Graph
  from MyCaffe import Function
label_desc: Use image node_id 11 for calling a global function with example usage: _convert_pool(node, graph, err) and returns: layer, err