o
    €o™iN  ã                   @   s<   d dl mZ d dlmZ d dlmZmZ G dd„ deƒZdS )é    )ÚUnion)ÚImageModule)ÚTensorÚtensorc                       sD   e Zd ZdZdeeef ddf‡ fdd„Zdedefdd	„Z‡  Z	S )
ÚRescalezwInitialize the Rescale operator.

    Args:
        factor: The scaling factor. Could be a float or a 0-d tensor.

    ÚfactorÚreturnNc                    sP   t ƒ  ¡  t|tƒrt|ƒ| _d S t|tƒr|jdkr#td|› dƒ‚|| _d S )Nr   z3Expected factor to be a float or a 0-d tensor, got Ú.)	ÚsuperÚ__init__Ú
isinstanceÚfloatr   r   r   ÚndimÚ	TypeError)Úselfr   ©Ú	__class__© úJ/home/ubuntu/.local/lib/python3.10/site-packages/kornia/enhance/rescale.pyr       s   


zRescale.__init__Úinputc                 C   s
   || j  S )N)r   )r   r   r   r   r   Úforward)   s   
zRescale.forward)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   Ú__classcell__r   r   r   r   r      s    	r   N)Útypingr   Úkornia.corer   ÚModuler   r   r   r   r   r   r   Ú<module>   s   