
    N j                         S SK Jr  S SKrS/r " S S\R                  R
                  R                  R                  5      rg)    )AnyNLSTMc                      \ rS rSrSr\R                  R                  R                  R                  r
S\4S jr\S\S\SS4S j5       r\S	\S    S
\R                  R                  R                  R                  SS 4S j5       rSrg)r      a&  A quantized 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 in :class:`~torch.ao.nn.quantizable.LSTM`

Examples::
    >>> # xdoctest: +SKIP
    >>> custom_module_config = {
    ...     'float_to_observed_custom_module_class': {
    ...         nn.LSTM: nn.quantizable.LSTM,
    ...     },
    ...     'observed_to_quantized_custom_module_class': {
    ...         nn.quantizable.LSTM: nn.quantized.LSTM,
    ...     }
    ... }
    >>> tq.prepare(model, prepare_custom_module_class=custom_module_config)
    >>> tq.convert(model, convert_custom_module_class=custom_module_config)
returnc                     g)NQuantizedLSTM )selfs    r/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/torch/ao/nn/quantized/modules/rnn.py	_get_nameLSTM._get_name'   s        argskwargsNc                     [        S5      e)NzrIt looks like you are trying to convert a non-observed LSTM module. Please, see the examples on quantizable LSTMs.)NotImplementedError)clsr   r   s      r   
from_floatLSTM.from_float*   s     "1
 	
r   r   otherc                     [        XR                  5      (       d$  [        SU R                   S[        U5       35      e[        R
                  R                  R                  USSS9nXl        U$ )NzExpected module type z, got FT)inplaceremove_qconfig)	
isinstance_FLOAT_MODULEAssertionErrortypetorchaoquantizationconvert	__class__)r   r   	converteds      r   from_observedLSTM.from_observed4   sq    %!2!233 '(9(9':&eN  HH))115 2 
	 "r   r
   )__name__
__module____qualname____firstlineno____doc__r   r    nnquantizabler   r   strr   classmethodr   r   r   r%   __static_attributes__r
   r   r   r   r      s    2 HHKK++00M3  
s 
c 
d 
 
 	4< 	0G0G0L0L 	QW 	 	r   )typingr   r   __all__r    r,   r-   r   r
   r   r   <module>r3      s7      
3588;;""'' 3r   