class_docstr: A quantizable long short-term memory (LSTM).
  
  For the description and the argument types, please, refer to :class:`~torch.nn.LSTM`
  
  Attributes:
      layers : instances of the `_LSTMLayer`
  
  .. note::
      To access the weights and biases, you need to access them per layer.
      See examples below.
  
  Examples::
  
      >>> import torch.ao.nn.quantizable as nnqa
      >>> rnn = nnqa.LSTM(10, 20, 2)
      >>> input = torch.randn(5, 3, 10)
      >>> h0 = torch.randn(2, 3, 20)
      >>> c0 = torch.randn(2, 3, 20)
      >>> output, (hn, cn) = rnn(input, (h0, c0))
      >>> # To get the weights:
      >>> # xdoctest: +SKIP
      >>> print(rnn.layers[0].weight_ih)
      tensor([[...]])
      >>> print(rnn.layers[0].weight_hh)
      AssertionError: There is no reverse path in the non-bidirectional layer
class_docstr_tok: ["A","quantizable","long","short-term","memory","(","LSTM",")",".","For","the","description","and","the","argument","types",",","please",",","refer","to",":","class",":","`","~torch.nn.LSTM","`","Attributes",":","layers",":","instances","of","the","`","_LSTMLayer","`","..","note",":",":","To","access","the","weights","and","biases",",","you","need","to","access","them","per","layer",".","See","examples","below",".","Examples",":",":",">",">",">","import","torch.ao.nn.quantizable","as","nnqa",">",">",">","rnn","=","nnqa.LSTM","(","10",",","20",",","2",")",">",">",">","input","=","torch.randn","(","5",",","3",",","10",")",">",">",">","h0","=","torch.randn","(","2",",","3",",","20",")",">",">",">","c0","=","torch.randn","(","2",",","3",",","20",")",">",">",">","output",",","(","hn",",","cn",")","=","rnn","(","input",",","(","h0",",","c0",")",")",">",">",">","#","To","get","the","weights",":",">",">",">","#","xdoctest",":","+SKIP",">",">",">","print","(","rnn.layers","[","0","]",".weight_ih",")","tensor","(","[","[","...","]","]",")",">",">",">","print","(","rnn.layers","[","0","]",".weight_hh",")","AssertionError",":","There","is","no","reverse","path","in","the","non-bidirectional","layer"]
code: def from_float(cls, other, qconfig=None):
      assert isinstance(other, cls._FLOAT_MODULE)
      assert hasattr(other, "qconfig") or qconfig
      observed = cls(
          other.input_size,
          other.hidden_size,
          other.num_layers,
          other.bias,
          other.batch_first,
          other.dropout,
          other.bidirectional,
      )
      observed.qconfig = getattr(other, "qconfig", qconfig)
      for idx in range(other.num_layers):
          observed.layers[idx] = _LSTMLayer.from_float(
              other, idx, qconfig, batch_first=False
          )
      # TODO: Remove setting observed to eval to enable QAT.
      observed.eval()
      observed = torch.ao.quantization.prepare(observed, inplace=True)
      return observed
  
imports: import numbers
  from typing import Optional, Tuple
  import warnings
  import torch
  from torch import Tensor
label_desc: Use image node_id 4 for calling the LSTM obj's underlying member method code with example usage: obj.from_float(cls, other, qconfig) and returns: observed