code: def _process_conv(context, node, add_relu=False):
      # Node has 4 inputs:
      # 1. The input activations
      # 2. The packed weights/biases (need to get from context.torch_graph)
      # 3. output scale
      # 4. output zero-point
  
      # Unpack weights/bias & dequantize weights.
      packed_params = context.torch_graph.params[node.inputs[1]]
      qweight, bias = _torch.ops.quantized.conv2d_unpack(packed_params)
      dequant_weights = _dequantized_weight(qweight)
      context.add(dequant_weights)
      # Bias can be fed as-is.
      bias = bias.detach().numpy()
  
      # Convolution Parameters.
      x, x_dtype = context.quant_context.get_dequantized_var(
          node.inputs[0]
      )
      raw_params = tuple(list(packed_params.__getstate__())[:-1])
      conv_attr_raw = (
          raw_params[0][1][0].detach().numpy().astype(_np.int32)
      )
      # Stride
      strides = conv_attr_raw[1:3]
      # Padding. torch.nn.quantized.Conv2d & its variants only support 'zeros' mode.
      pad = conv_attr_raw[3:5]
      assert conv_attr_raw[8] == 0
      if len(dequant_weights.shape) in (3, 4):
          # 1D and 2D: Need to explicitly state L-R, T-B pad
          pad = _np.repeat(pad, 2)
      else:
          raise ValueError(
              "Invalid weight dimension. Must be 4 for 2D convolution."
          )
      # Dilation.
      dilations = conv_attr_raw[5:7]
      # Group.
      group = conv_attr_raw[9]
      kwargs = {
          "x": x,
          "weight": dequant_weights,
          "bias": bias,
          "strides": strides,
          "pad_type": "custom",
          "pad": pad,
          "dilations": dilations,
      }
      if group > 0:
          kwargs["groups"] = group
  
      res = mb.conv(**kwargs)
      if add_relu:
          res = mb.relu(x=res)
      context.add(res)
  
      out_scale = context[node.inputs[2]]
      out_zero_point = context[node.inputs[3]].val
      context.quant_context.get_quantized_per_tensor(
          res.name, x_dtype, out_scale, out_zero_point, node.name
      )
  
imports: import numpy
  import torch
  from coremltools import _logger
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Var, types
  from .ops import NUM_TO_TORCH_DTYPE, _create_linear_layer, _get_inputs, promote_input_dtypes
  from .torch_op_registry import register_torch_op
label_desc: Use image node_id 7 for calling a global function with example usage: _process_conv(context, node, add_relu) without return types