code: def wider_pre_conv(layer, n_add_filters, weighted=True):
      """wider previous conv layer."""
      n_dim = get_n_dim(layer)
      if not weighted:
          return get_conv_class(n_dim)(
              layer.input_channel,
              layer.filters + n_add_filters,
              kernel_size=layer.kernel_size,
          )
  
      n_pre_filters = layer.filters
      rand = np.random.randint(n_pre_filters, size=n_add_filters)
      teacher_w, teacher_b = layer.get_weights()
  
      student_w = teacher_w.copy()
      student_b = teacher_b.copy()
      # target layer update (i)
      for i, _ in enumerate(rand):
          teacher_index = rand[i]
          new_weight = teacher_w[teacher_index, ...]
          new_weight = new_weight[np.newaxis, ...]
          student_w = np.concatenate((student_w, new_weight), axis=0)
          student_b = np.append(student_b, teacher_b[teacher_index])
      new_pre_layer = get_conv_class(n_dim)(
          layer.input_channel,
          n_pre_filters + n_add_filters,
          layer.kernel_size,
      )
      new_pre_layer.set_weights(
          (
              add_noise(student_w, teacher_w),
              add_noise(student_b, teacher_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 4 for calling a global function with example usage: wider_pre_conv(layer, n_add_filters, weighted) and returns: new_pre_layer, get_conv_class