code: def pool2d_rewrite(ref_call, new_args, ctx):
      """Rewrite function for max pool2d"""
      if quantize_context().check_to_skip(ref_call):
          return None
  
      expr, x_kind = _get_expr_kind(new_args[0])
  
      if x_kind is None:
          return None
      if x_kind == QAnnotateKind.ACTIVATION:
          expr = attach_simulated_quantize(expr, QAnnotateKind.INPUT)
  
      expr = _forward_op(ref_call, [expr])
      return QAnnotateExpr(expr, QAnnotateKind.INPUT)
  
imports: import warnings
  from tvm import topi
  import tvm._ffi
  from tvm.relay.op import op
  from ..None import expr
  from ..None import analysis
  from ..None import op
  from .None import _quantize
  from .quantize import QAnnotateKind, current_qconfig, quantize_context
  from .quantize import _forward_op
label_desc: Use image node_id 12 for calling a global function with example usage: pool2d_rewrite(ref_call, new_args, ctx) and returns: QAnnotateExpr, None, None