code: def test_quantized_linear(self, use_relu, input_rank, quant_dtype):
      class Model(torch.nn.Module):
          def __init__(self):
              super().__init__()
              if use_relu:
                  linear = torch.nn.intrinsic.quantized.LinearReLU
              else:
                  linear = torch.nn.quantized.Linear
              self.quant_linear = linear(5, 4)
  
          def forward(self, x):
              x = torch.quantize_per_tensor(
                  x, scale=1.0, zero_point=0, dtype=quant_dtype
              )
              x = self.quant_linear(x)
              return torch.dequantize(x)
  
      model = Model()
  
      if input_rank == 2:
          input_shape = (3, 5)
      elif input_rank == 3:
          input_shape = (1, 3, 5)
      elif input_rank == 4:
          input_shape = (1, 2, 3, 5)
      self.run_compare_torch([input_shape], model)
  
imports: import itertools
  from typing import Optional
  import numpy
  import pytest
  import torch
  import torchvision
  import coremltools
  from coremltools import TensorType
  from coremltools._deps import _HAS_TORCH, _HAS_TORCH_VISION, MSG_TORCH_NOT_FOUND, MSG_TORCH_VISION_NOT_FOUND
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from .testing_utils import TorchBaseTest
label_desc: Use image node_id 1 for calling the TestPytorchQuantizedOps obj's underlying member method code with example usage: obj.test_quantized_linear(use_relu, input_rank, quant_dtype) and returns: torch