code: def _conv2d_legalize(attrs, inputs, arg_types):
      """Legalize conv2d op for vrmpy tensorization.
  
      If the inputs are signed or unsigned int8, the input and output channels are padded to be
      a multiple of 4 and 32 respectively.
  
      If the input data types are (int8, int8), they are converted to (uint8, int8) and
      the vector-by-vector variant of vrmpy is applied.
      If the input data types are (uint8, uint8), the more efficient vector-by-scalar variant of vrmpy
      is applied.
  
      Unlike the nn.dense case (see dense_alter_op.py), we do not convert (uint8, int8) to
      (uint8, uint8). That would introduce another convolution by a constant (128 or 1) filter,
      to compensate for the dtype legalization. In the nn.dense case, such compensation factor is
      just a sum over the K axis.
      """
      data_layout = attrs["data_layout"]
      kernel_layout = attrs["kernel_layout"]
  
      output_tensor = arg_types[2]
  
      data, kernel = inputs
  
      if data_layout != "NCHW" or kernel_layout != "OIHW":
          return None
  
      data_tensor, kernel_tensor = arg_types[0], arg_types[1]
  
      if "int8" in data_tensor.dtype and "int8" in data_tensor.dtype:
          output_tensor = arg_types[2]
          data, kernel = inputs
          desired_data_dtype = "uint8"
          in_channel_vector_length = 4
          out_channel_vector_length = 32
  
          return conv2d_alter_int8_common(
              data,
              data_tensor,
              kernel,
              kernel_tensor,
              output_tensor,
              attrs,
              desired_data_dtype,
              in_channel_vector_length,
              out_channel_vector_length,
          )
  
      return None
  
imports: from tvm import relay
  from ..utils import get_const_tuple
  from ..None import nn
  from ..nn import 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, None, conv2d_alter_int8_common