class_docstr: ## Switch Transformer
class_docstr_tok: ["#","#","Switch","Transformer"]
code: def __init__(self, layer: SwitchTransformerLayer, n_layers: int):
      super().__init__()
      # Make copies of the transformer layer
      self.layers = clone_module_list(layer, n_layers)
      # Final normalization layer
      self.norm = nn.LayerNorm([layer.size])
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/transformers/switch/__init__.py
imports: import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.mha import MultiHeadAttention
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 1 to create a new SwitchTransformer object from inherited base classes: Module with example: obj = SwitchTransformer(layer, n_layers)