class_docstr: ### Stack Module
  
  This uses the stack function defined above, and does the necessary initializations.
class_docstr_tok: ["#","#","#","Stack","Module","This","uses","the","stack","function","defined","above",",","and","does","the","necessary","initializations","."]
docstr: * `max_len` is the maximum size of the stack
docstr_tok: ["*","`","max_len","`","is","the","maximum","size","of","the","stack"]
code: def __init__(self, max_len: int):
      """
      * `max_len` is the maximum size of the stack
      """
      self.max_len = max_len
      self.memory = None
      self.memory_grad = None
      self.last = None
      self.n = -1
      self.last_get_n = -1
  
imports: import math
  from typing import Optional
  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 PrepareForMultiHeadAttention
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 1 to create a new Stack object  with example: obj = Stack(max_len)