code: def make_layers(config, batch_norm=False, end_with="outputs"):
      layer_list = []
      is_end = False
      for layer_group_idx, layer_group in enumerate(config):
          if isinstance(layer_group, list):
              for idx, layer in enumerate(layer_group):
                  layer_name = layer_names[layer_group_idx][idx]
                  n_filter = layer
                  if idx == 0:
                      if layer_group_idx > 0:
                          in_channels = config[layer_group_idx - 2][-1]
                      else:
                          in_channels = 3
                  else:
                      in_channels = layer_group[idx - 1]
                  layer_list.append(
                      Conv2d(
                          n_filter=n_filter,
                          filter_size=(3, 3),
                          strides=(1, 1),
                          act=tf.nn.relu,
                          padding="SAME",
                          in_channels=in_channels,
                          name=layer_name,
                      )
                  )
                  if batch_norm:
                      layer_list.append(BatchNorm())
                  if layer_name == end_with:
                      is_end = True
                      break
          else:
              layer_name = layer_names[layer_group_idx]
              if layer_group == "M":
                  layer_list.append(
                      MaxPool2d(
                          filter_size=(2, 2),
                          strides=(2, 2),
                          padding="SAME",
                          name=layer_name,
                      )
                  )
              elif layer_group == "O":
                  layer_list.append(
                      Dense(
                          n_units=1000,
                          in_channels=4096,
                          name=layer_name,
                      )
                  )
              elif layer_group == "F":
                  layer_list.append(Flatten(name="flatten"))
              elif layer_group == "fc1":
                  layer_list.append(
                      Dense(
                          n_units=4096,
                          act=tf.nn.relu,
                          in_channels=512 * 7 * 7,
                          name=layer_name,
                      )
                  )
              elif layer_group == "fc2":
                  layer_list.append(
                      Dense(
                          n_units=4096,
                          act=tf.nn.relu,
                          in_channels=4096,
                          name=layer_name,
                      )
                  )
              if layer_name == end_with:
                  is_end = True
          if is_end:
              break
      return LayerList(layer_list)
  
file_path: TensorLayer/tensorlayer/models/vgg.py
imports: import os
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.files import assign_weights, maybe_download_and_extract
  from tensorlayer.layers import BatchNorm, Conv2d, Dense, Flatten, Input, Lambda, LayerList, MaxPool2d
  from tensorlayer.models import Model
label_desc: Use image node_id 1 for calling a global function with example usage: make_layers(config, batch_norm, end_with) and returns: LayerList