code: def _conv2d_legalize(attrs, inputs, arg_types):
      """Legalizes Conv2D op.
  
      Parameters
      ----------
      attrs : tvm.ir.Attrs
          Attributes of current convolution
      inputs : list of tvm.relay.Expr
          The args of the Relay expr to be legalized
      types : list of types
          List of input and output types
  
      Returns
      -------
      result : tvm.relay.Expr
          The legalized expr
      """
      # Collect the input tensors.
      data_tensor, kernel_tensor = arg_types[0], arg_types[1]
      data_dtype = data_tensor.dtype
      kernel_dtype = kernel_tensor.dtype
  
      # Collect the output tensor.
      output_tensor = arg_types[2]
  
      # Collect the input exprs.
      data, kernel = inputs
  
      # Intel vector intructions require data and kernel to have different dtypes.
      if data_tensor.dtype == "int8" and kernel_tensor.dtype == "int8":
          data_dtype = "uint8"
      if is_int8_hw_support(data_dtype, kernel_dtype):
          return conv2d_alter_int8_common(
              data,
              data_tensor,
              kernel,
              kernel_tensor,
              output_tensor,
              attrs,
              data_dtype,
              4,
              16,
          )
      return None
  
file_path: tvm/python/tvm/topi/x86/conv2d_alter_op.py
imports: import logging
  import re
  import tvm
  from tvm import te
  from tvm import relay
  from tvm import autotvm
  from .conv2d import _get_default_config
  from .conv2d_int8 import is_int8_hw_support, _get_default_config_int8
  from ..utils import get_const_tuple
  from ..nn import conv2d_legalize, conv2d_alter_layout
  from ..generic.conv2d import conv2d_alter_int8_common
label_desc: Use image node_id 2 for calling a global function with example usage: _conv2d_legalize(attrs, inputs, arg_types) and returns: None, conv2d_alter_int8_common