BackendConfig,
          BackendPatternConfig,
          DTypeConfig,
          ObservationType,
      )
  weighted_int8_dtype_config = DTypeConfig(
      input_dtype=torch.quint8,
      output_dtype=torch.quint8,
      weight_dtype=torch.qint8,
      bias_dtype=torch.float)

  def fuse_conv2d_relu(is_qat, conv, relu):
      return torch.ao.nn.intrinsic.ConvReLU2d(conv, relu)

  # For quantizing Linear
  linear_config = BackendPatternConfig(torch.nn.Linear)             .set_observation_type(ObservationType.OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT)             .add_dtype_config(weighted_int8_dtype_config)             .set_root_module(torch.nn.Linear)             .set_qat_module(torch.ao.nn.qat.Linear)             .set_reference_quantized_module(torch.ao.nn.quantized.reference.Linear)

  # For fusing Conv2d + ReLU into ConvReLU2d
