code: def __init__(self, params, attr_name, zero_fill):
      n_params = len(params)
      params_dptr = np.empty(n_params, dtype=np.int64)
      params_dtype = np.empty(n_params, dtype=np.int32)
      params_size_csum = np.empty(n_params + 1, dtype=np.int32)
      params_size_csum[0] = 0
      for i, param in enumerate(params):
          v = getattr(param, attr_name)
          if attr_name == "grad" and v is None and zero_fill:
              v = param.xp.zeros_like(param.data)
              setattr(param, attr_name, v)
          xp = chainer.backend.get_array_module(v)
  
          if xp == cp:
              v_data = v.data
          elif xp == chx:
              v_data = _get_memory_pointer_from_chainerx(v)
          else:
              raise ValueError(
                  "{} is from an unsupported array module".format(
                      type(v)
                  )
              )
  
          params_dptr[i] = v_data.ptr
          if v.dtype not in [np.float16, np.float32, np.float64]:
              raise ValueError(
                  "dtype must be float16, float32 or float64."
              )
          params_dtype[i] = _communication_utility._get_nccl_type_id(
              v.dtype
          )
          params_size_csum[i + 1] = params_size_csum[i] + v.size
      self.n_params = n_params
      self.n_elems = params_size_csum[n_params]
      self.size_csum = chainer.cuda.cupy.asarray(params_size_csum)
      self.dtype = chainer.cuda.cupy.asarray(params_dtype)
      self.dptr = chainer.cuda.cupy.asarray(params_dptr)
  
imports: import ctypes
  import mpi4py.MPI
  import numpy
  from chainermn.communicators import _communication_utility
  import chainer.backends
  import chainerx
label_desc: Use image node_id 1 to create a new ParamsData object from inherited base classes: object with example: obj = ParamsData(params, attr_name, zero_fill)