code: def emit_Pool(self, IR_node):
      pooling_type = IR_node.get_attr("pooling_type")
      if pooling_type == "MAX":
          pooling_type = P.Pooling.MAX
      elif pooling_type == "AVG":
          pooling_type = P.Pooling.AVE
      elif pooling_type == "STOCHASTIC":
          pooling_type = P.Pooling.STOCHASTIC
      else:
          raise ValueError()
  
      if IR_node.layer.attr["global_pooling"].b:
          self.add_body(
              1,
              "n.{:<15} = L.Pooling(n.{}, pool={}, stride={}, global_pooling=True, ntop=1)".format(
                  IR_node.variable_name,
                  self.parent_variable_name(IR_node),
                  pooling_type,
                  IR_node.get_attr("strides")[1],
              ),
          )
      else:
          pad_h, pad_w = self._get_symmetric_padding(IR_node)
          pool_size = IR_node.get_attr("kernel_shape")[1:3]
          if pool_size[0] != pool_size[1]:
              self.add_body(
                  1,
                  "n.{:<15} = L.Pooling(n.{}, pool={}, kernel_h={}, kernel_w={}, pad_h={}, pad_w={}, stride={}, ntop=1)".format(
                      IR_node.variable_name,
                      self.parent_variable_name(IR_node),
                      pooling_type,
                      pool_size[0],
                      pool_size[1],
                      pad_h,
                      pad_w,
                      IR_node.get_attr("strides")[1],
                  ),
              )
          else:
              self.add_body(
                  1,
                  "n.{:<15} = L.Pooling(n.{}, pool={}, kernel_size={}, pad_h={}, pad_w={}, stride={}, ntop=1)".format(
                      IR_node.variable_name,
                      self.parent_variable_name(IR_node),
                      pooling_type,
                      pool_size[0],
                      pad_h,
                      pad_w,
                      IR_node.get_attr("strides")[1],
                  ),
              )
  
          # check if need crop output shape
          self.check_if_need_crop(IR_node)
  
imports: from __future__ import division
  import os
  import sys
  import math
  import numpy
  import caffe
  from caffe import layers
  from caffe import params
  from mmdnn.conversion.common.IR.IR_graph import IRGraph, IRGraphNode
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
  from mmdnn.conversion.common.DataStructure.emitter import Emitter
  from mmdnn.conversion.common.utils import *
label_desc: Use image node_id 12 for calling the CaffeEmitter obj's underlying member method code with example usage: obj.emit_Pool(IR_node) without return types