code: def wider_pre_dense(layer, n_add, weighted=True):
      """wider previous dense layer."""
      if not weighted:
          return StubDense(layer.input_units, layer.units + n_add)
  
      n_units2 = layer.units
  
      teacher_w, teacher_b = layer.get_weights()
      rand = np.random.randint(n_units2, size=n_add)
      student_w = teacher_w.copy()
      student_b = teacher_b.copy()
  
      # target layer update (i)
      for i in range(n_add):
          teacher_index = rand[i]
          new_weight = teacher_w[teacher_index, :]
          new_weight = new_weight[np.newaxis, :]
          student_w = np.concatenate(
              (student_w, add_noise(new_weight, student_w)), axis=0
          )
          student_b = np.append(
              student_b, add_noise(teacher_b[teacher_index], student_b)
          )
  
      new_pre_layer = StubDense(layer.input_units, n_units2 + n_add)
      new_pre_layer.set_weights((student_w, student_b))
  
      return new_pre_layer
  
file_path: nni/nni/algorithms/hpo/networkmorphism_tuner/layer_transformer.py
imports: import numpy
  from .layers import StubDense, StubReLU, get_batch_norm_class, get_conv_class, get_n_dim
label_desc: Use image node_id 3 for calling a global function with example usage: wider_pre_dense(layer, n_add, weighted) and returns: new_pre_layer, StubDense