code: def test_init(self):
      device = "cpu"
      with self.assertRaises(AssertionError):
          # different shapes between input shape
          # and init tensor
          p = ParamData(
              "test",
              shape=(3, 3),
              device=device,
              init_tensor=torch.randn(3, 2),
          )
  
      with self.assertRaises(AssertionError):
          # missing either shape or init tensor
          p = ParamData("test", device=device)
  
      p = ParamData(
          "test", device=device, init_tensor=torch.randn(2, 3)
      )
      self.assertEqual(p.data.shape, p.shape)
  
      p = ParamData("test", device=device, shape=(2, 3))
      self.assertEqual(p.data.shape, p.shape)
  
      p = ParamData(
          "test", device=device, shape=(2, 3), init_function=torch.ones
      )
      self.assertEqual(p.data.shape, p.shape)
      self.assertTrue((torch.ones(2, 3) == p.data).all())
  
file_path: avalanche/tests/training/test_training_utils.py
imports: import unittest
  import torch
  from avalanche.training.utils import ParamData
label_desc: Use image node_id 1 for calling the TestParamData obj's underlying member method code with example usage: obj.test_init() without return types