class_docstr: Test class to check the initialization of adapters.
class_docstr_tok: ["Test","class","to","check","the","initialization","of","adapters","."]
code: def test_lora_conv2d_default(self):
      # default is True
      torch.manual_seed(0)
  
      model = self.get_model()
      config = LoraConfig(target_modules=["conv2d"])
      model = get_peft_model(model, config)
      weight_A = model.conv2d.lora_A["default"].weight
      weight_B = model.conv2d.lora_B["default"].weight
  
      # use statistical test to check if weight A is from a uniform distribution
      unif = self.get_uniform(
          weight_A.min().item(), weight_A.max().item()
      )
      _, p_value = stats.kstest(
          weight_A.detach().flatten().cpu().numpy(),
          unif.flatten().cpu().numpy(),
      )
      self.assertGreater(p_value, 0.5)
  
      # check that weight A is *not* from a normal distribution
      normal = self.get_normal(
          weight_A.mean().item(), weight_A.std().item()
      )
      _, p_value = stats.kstest(
          weight_A.detach().flatten().cpu().numpy(),
          normal.flatten().cpu().numpy(),
      )
      self.assertLess(p_value, 0.05)
  
      # check that weight B is zero
      self.assertTrue((weight_B == 0.0).all())
  
imports: import unittest
  import torch
  from scipy import stats
  from torch import nn
  from peft import LoraConfig, get_peft_model
  from peft.utils import infer_device
label_desc: Use image node_id 10 for calling the InitializationTest obj's underlying member method code with example usage: obj.test_lora_conv2d_default() without return types