
    sg                     x    d dl Z dgZ G d de j                  j                  j                  j
                        Zy)    NLSTMc                       e Zd ZdZej
                  j                  j                  j                  Z	d Z
ed        Zed        Zy)r   ar  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)
    c                      y)NQuantizedLSTM )selfs    T/var/www/html/venv/lib/python3.12/site-packages/torch/ao/nn/quantized/modules/rnn.py	_get_namezLSTM._get_name%   s        c                     t        d      )NzrIt looks like you are trying to convert a non-observed LSTM module. Please, see the examples on quantizable LSTMs.)NotImplementedError)clsargskwargss      r	   
from_floatzLSTM.from_float(   s     "1
 	
r   c                     t        |      | j                  k(  sJ t        j                  j                  j                  |dd      }| |_        |S )NFT)inplaceremove_qconfig)type_FLOAT_MODULEtorchaoquantizationconvert	__class__)r   other	converteds      r	   from_observedzLSTM.from_observed2   sP    E{c/////HH))115 2 
	 "	r   N)__name__
__module____qualname____doc__r   r   nnquantizabler   r   r
   classmethodr   r   r   r   r	   r   r   
   sO    0 HHKK++00M 
 
  r   )r   __all__r   r#   r$   r   r   r   r	   <module>r'      s4     
/588;;""'' /r   