docstr: Test that we can get example inputs for functions with default keyword arguments
          
docstr_tok: ["Test","that","we","can","get","example","inputs","for","functions","with","default","keyword","arguments"]
code: def test_get_fqn_to_example_inputs_default_kwargs(self):
      """Test that we can get example inputs for functions with default keyword arguments"""
  
      class Sub(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.linear1 = torch.nn.Linear(5, 5)
              self.linear2 = torch.nn.Linear(5, 5)
  
          def forward(self, x, key1=torch.rand(1), key2=torch.rand(1)):
              x = self.linear1(x)
              x = self.linear2(x)
              return x
  
      class M(torch.nn.Module):
          def __init__(self):
              super().__init__()
              self.linear1 = torch.nn.Linear(5, 5)
              self.linear2 = torch.nn.Linear(5, 5)
              self.sub = Sub()
  
          def forward(self, x):
              x = self.linear1(x)
              x = self.linear2(x)
              # only override `key2`, `key1` will use default
              x = self.sub(x, key2=torch.rand(1, 2))
              return x
  
      expected_fqn_to_dim = {
          "": (2,),
          "linear1": (2,),
          "linear2": (2,),
          # second arg is `key1`, which is using default argument
          # third arg is `key2`, override by callsite
          "sub": (2, 1, 2),
          "sub.linear1": (2,),
          "sub.linear2": (2,),
      }
      example_inputs = (torch.rand(1, 5),)
      self._test_get_fqn_to_example_inputs(
          M, example_inputs, expected_fqn_to_dim
      )
  
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 3 for calling the TestUtils obj's underlying member method code with example usage: obj.test_get_fqn_to_example_inputs_default_kwargs() and returns: x, x