o
    "j\
                     @   s(   d dl mZmZ d dlmZ dd ZdS )    )
check_typecheck_variable_and_dtype)LayerHelperc                 C   s~   t di t }|j| jd}t| dg dd t|dddgd t|dtd d|i}|jd| g|gd	d
|gi|d |S )a  

    **unzip layers**

    unzip 'input' accroding to 'lod'

    Args:
        input (Variable): The zipped input
        len(int): The second dim length of unzipped output.
        lod (Variable): The original lod of unzipped input, 1-D LodTensor with shape[K].

    Returns:
        Variable: The original unzipped tensor, 2-D LodTensor with shape[K-1, len].

    Examples:

        .. code-block:: python

            >>> # doctest: +REQUIRES(env:GPU)
            >>> import numpy as np
            >>> import paddle
            >>> paddle.set_device('gpu')
            >>> input_np = np.array([1, 2, 3, 1, 2, 4])
            >>> lod_np = np.array([0, 3, 3, 3, 4, 6])
            >>> len = 4
            >>> input = paddle.to_tensor(input_np, "int64")
            >>> lod = paddle.to_tensor(lod_np, "int64")
            >>> unzipped_input = paddle.incubate.operators.unzip(input, lod, len)
            >>> print(unzipped_input)
            Tensor(shape=[5, 4], dtype=int64, place=Place(gpu:0), stop_gradient=True,
                   [[1, 2, 3, 0],
                    [0, 0, 0, 0],
                    [0, 0, 0, 0],
                    [1, 0, 0, 0],
                    [2, 4, 0, 0]])

    unzip)dtypeinput)Zfloat16Zfloat32Zfloat64intboolint64Z	complex64Z
complex128lodr   r
   len)Xr   Y)typeZinputsZoutputsattrsN)r   )r   localsZcreate_variabler   r   r   r   Z	append_op)r   r   r   helperoutr    r   `/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddle/incubate/operators/unzip.pyr      s$   &
r   N)Zpaddle.base.data_feederr   r   Zpaddle.base.layer_helperr   r   r   r   r   r   <module>   s   