class_docstr: # HyperLSTM module
class_docstr_tok: ["#","HyperLSTM","module"]
docstr: Create a network of `n_layers` of HyperLSTM.
docstr_tok: ["Create","a","network","of","`","n_layers","`","of","HyperLSTM","."]
code: def __init__(
      self,
      input_size: int,
      hidden_size: int,
      hyper_size: int,
      n_z: int,
      n_layers: int,
  ):
      """
      Create a network of `n_layers` of HyperLSTM.
      """
  
      super().__init__()
  
      # Store sizes to initialize state
      self.n_layers = n_layers
      self.hidden_size = hidden_size
      self.hyper_size = hyper_size
  
      # Create cells for each layer. Note that only the first layer gets the input directly.
      # Rest of the layers get the input from the layer below
      self.cells = nn.ModuleList(
          [HyperLSTMCell(input_size, hidden_size, hyper_size, n_z)]
          + [
              HyperLSTMCell(hidden_size, hidden_size, hyper_size, n_z)
              for _ in range(n_layers - 1)
          ]
      )
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/hypernetworks/hyper_lstm.py
imports: from typing import Optional, Tuple
  import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.lstm import LSTMCell
label_desc: Use image node_id 1 to create a new HyperLSTM object from inherited base classes: Module with example: obj = HyperLSTM(input_size, hidden_size, hyper_size, n_z, n_layers)