o
    + i                     @  sr   d dl mZ d dlZd dlmZmZ d dlmZ er,d dlm	Z	 d dl
mZ d dlmZ G dd deejd	ZdS )
    )annotationsN)TYPE_CHECKINGAny)Layer)Iterable)Tensorc                      sr   e Zd ZdZd fddZejdd	d
ZejdddZejdddZ	ejdddZ
ejdddZ  ZS )BaseQuanterzw
    Built-in quanters and customized quanters should extend this base quanter
    and implement abstract methods.
    returnNonec                   s   t    d S N)super__init__self	__class__ l/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/paddle/quantization/base_quanter.pyr   #   s   zBaseQuanter.__init__inputr   Tensor | npt.NDArray[Any]c                 C  s   d S r   r   )r   r   r   r   r   forward&   s   zBaseQuanter.forwardc                 C     dS )z
        Get the scales used for quantization.
        It can be none which means the quanter didn't hold scales for quantization.
        Nr   r   r   r   r   scales*      zBaseQuanter.scalesc                 C  r   )z
        Get the zero points used for quantization.
        It can be none which means the quanter didn't hold zero points for quantization.
        Nr   r   r   r   r   zero_points2   r   zBaseQuanter.zero_pointsint | Iterable[int]c                 C  r   )zT
        Get the axis of quantization. None means tensor-wise quantization.
        Nr   r   r   r   r   
quant_axis:      zBaseQuanter.quant_axisc                 C  r   )z5
        Get the bit length of quantization.
        Nr   r   r   r   r   
bit_lengthA   r   zBaseQuanter.bit_length)r	   r
   )r   r   r	   r   )r	   r   )r	   r   )__name__
__module____qualname____doc__r   abcabstractmethodr   r   r   r   r   __classcell__r   r   r   r   r      s    r   )	metaclass)
__future__r   r#   typingr   r   Z	paddle.nnr   collections.abcr   Znumpy.typingZnptZpaddler   ABCMetar   r   r   r   r   <module>   s   