docstr: Test that all parametrizations and their associated parameters are transferred.
docstr_tok: ["Test","that","all","parametrizations","and","their","associated","parameters","are","transferred","."]
code: def test_transfer_parametrizations_and_params_single_param(self):
      r"""Test that all parametrizations and their associated parameters are transferred."""
  
      class AddOne(nn.Module):
          def forward(self, x):
              return x + 1.0
  
      class Double(nn.Module):
          def forward(self, x):
              return 2.0 * x
  
      class MinusOne(nn.Module):
          def forward(self, x):
              return x - 1.0
  
      model = nn.Linear(5, 5, bias=True)
      parametrize.register_parametrization(model, "weight", AddOne())
      parametrize.register_parametrization(model, "weight", Double())
      parametrize.register_parametrization(model, "weight", MinusOne())
      parametrize.register_parametrization(model, "bias", AddOne())
      parametrize.register_parametrization(model, "bias", Double())
      parametrize.register_parametrization(model, "bias", MinusOne())
  
      to_model = torch.ao.nn.qat.Linear(
          5,
          5,
          bias=True,
          qconfig=torch.ao.quantization.get_default_qconfig(),
      )
      parametrize.transfer_parametrizations_and_params(
          model, to_model, "weight"
      )
  
      # check that weight and only weight was transferred
      self.assertEqual(model.weight, to_model.weight)
      self.assertEqual(
          model.parametrizations.weight.original,
          to_model.parametrizations.weight.original,
      )
      self.assertTrue("bias" not in to_model.parametrizations)
  
imports: from copy import deepcopy
  from itertools import product
  import pickle
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.nn.init
  import torch.nn.utils.parametrize
  from torch.nn import Parameter
  from torch.testing._internal.common_utils import run_tests, skipIfNoLapack, TemporaryFileName, instantiate_parametrized_tests, set_default_dtype
  from torch.testing._internal.common_device_type import instantiate_device_type_tests
  from torch.testing._internal.common_cuda import TEST_MULTIGPU
  from torch.testing._internal.common_nn import NNTestCase
  from torch.testing._internal.common_utils import gradcheck
label_desc: Use image node_id 16 for calling the TestNNParametrization obj's underlying member method code with example usage: obj.test_transfer_parametrizations_and_params_single_param() and returns: unknown, unknown, unknown