class_docstr: A variant of MLP in which we introduce skip connections between
  successive layers in case the dimensions allow it
class_docstr_tok: ["A","variant","of","MLP","in","which","we","introduce","skip","connections","between","successive","layers","in","case","the","dimensions","allow","it"]
code: def create_layers(
      model_config: AttrDict,
      dims: List[int],
      use_bn: bool = False,
      use_relu: bool = False,
      use_dropout: bool = False,
      use_bias: bool = True,
      skip_last_layer_relu_bn: bool = True,
  ):
      layers = []
      last_dim = dims[0]
      for i, dim in enumerate(dims[1:]):
          keep_relu_bn_drop = not (
              i == len(dims) - 2 and skip_last_layer_relu_bn
          )
          layers.append(
              MLPResidualBlock(
                  model_config=model_config,
                  input_dim=last_dim,
                  output_dim=dim,
                  use_bias=use_bias,
                  use_bn=use_bn and keep_relu_bn_drop,
                  use_relu=use_relu and keep_relu_bn_drop,
                  use_dropout=use_dropout and keep_relu_bn_drop,
              )
          )
          last_dim = dim
      return layers
  
file_path: vissl/vissl/models/heads/mlp_res.py
imports: from typing import List
  import torch
  import torch.nn
  from vissl.config import AttrDict
  from vissl.models.heads import register_model_head
label_desc: Use image node_id 2 for calling the MLPResidual obj's underlying member method code with example usage: obj.create_layers(model_config, dims, use_bn, use_relu, use_dropout, use_bias, skip_last_layer_relu_bn) and returns: layers