code: def test_uint1_7_dtype(self):
      def up_size(size):
          return (*size[:-1], size[-1] * 2)
  
      class UInt4Tensor(torch.Tensor):
          @staticmethod
          def __new__(cls, elem, **kwargs):
              assert elem.dtype is torch.uint8
              assert not kwargs.get("requires_grad", False)
              kwargs["requires_grad"] = False
              return torch.Tensor._make_wrapper_subclass(
                  cls, up_size(elem.shape), dtype=torch.uint4, **kwargs
              )
  
          def __init__(self, elem):
              self.elem = elem
  
          @classmethod
          def __torch_dispatch__(cls, func, types, args, kwargs=None):
              pass
  
      # make sure it runs
      x = UInt4Tensor(
          torch.tensor(
              [
                  [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF],
                  [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF],
                  [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF],
              ],
              dtype=torch.uint8,
          )
      )
      assert x.dtype == torch.uint4
  
file_path: pytorch/test/quantization/core/test_utils.py
imports: import torch
  from torch.testing._internal.common_utils import TestCase
  from torch.ao.quantization.utils import get_fqn_to_example_inputs
  from torch.ao.nn.quantized.modules.utils import _quantize_weight
  from torch.ao.quantization import MovingAverageMinMaxObserver, MovingAveragePerChannelMinMaxObserver
label_desc: Use image node_id 7 for calling the TestUtils obj's underlying member method code with example usage: obj.test_uint1_7_dtype() and returns: unknown,  unknown, torch