code: def test_weights_parametrized(self):
      model = ModelUnderTest(bias=False)
  
      assert not hasattr(model.linear, "parametrizations")
      assert not hasattr(model.seq[0], "parametrizations")
      assert not hasattr(model.seq[1], "parametrizations")
      mask = torch.eye(16)
      parametrize.register_parametrization(
          model.linear, "weight", utils.FakeSparsity(mask)
      )
      mask = torch.eye(16)
      parametrize.register_parametrization(
          model.seq[0], "weight", utils.FakeSparsity(mask)
      )
      mask = torch.eye(16)
      parametrize.register_parametrization(
          model.seq[1], "weight", utils.FakeSparsity(mask)
      )
  
      assert hasattr(model.linear, "parametrizations")
      assert parametrize.is_parametrized(model.linear, "weight")
      assert hasattr(model.seq[0], "parametrizations")
      assert parametrize.is_parametrized(model.linear, "weight")
      assert hasattr(model.seq[1], "parametrizations")
      assert parametrize.is_parametrized(model.linear, "weight")
  
file_path: pytorch/test/ao/sparsity/test_parametrization.py
imports: import logging
  from torch import nn
  from torch.ao.pruning.sparsifier import utils
  from torch.nn.utils import parametrize
  import torch
  from torch.testing._internal.common_utils import TestCase
label_desc: Use image node_id 2 for calling the TestFakeSparsity obj's underlying member method code with example usage: obj.test_weights_parametrized() without return types