o
    "jS
                     @   sB   d dl mZ d dlmZ d dlmZ d dlmZ g Zd	ddZ	dS )
    )_C_ops)check_variable_and_dtype)LayerHelper)in_dynamic_modec                 C   sl   t  r	t| |S t| dg dd td	i t }|j| j| jd}|j	dd| gid|gid|id |S )
aI  

    This OP takes in the Tensor :attr:`x` and change it to ouptut with
    aclFormat with int value. This API is only used for Ascend NPU.

    Args:
        x(Tensor): An input N-D Tensor with data type bool, float16,
                   float32, float64, int32, int64, int16, int8, uint8.
        format(int): Storage data format of the output in aclFormat,
                     default value is -1.

    Returns:
        Tensor: A Tensor with acl storage format on Ascend NPU.

    Examples:
        .. code-block:: python

            >>> # doctest: +REQUIRES(env:NPU)
            >>> import paddle
            >>> paddle.device.set_device('npu')

            >>> x = paddle.ones(shape=[6])
            >>> y = paddle.incubate._npu_identity(x, 3) # ACL_FORMAT_NC1HWC0 = 3
            >>> print(y.shape)
            [1, 1, 1, 1, 16]
    x)	boolZint8Zuint8Zint16Zint32Zint64Zfloat16Zfloat32Zfloat64npu_identity)dtypestop_gradientoutformat)typeZinputsZoutputsattrsN)r	   )
r   r   r	   r   r   localsZ"create_variable_for_type_inferencer
   r   Z	append_op)r   r   helperr    r   d/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddle/incubate/tensor/manipulation.py_npu_identity   s&   r   N)r   )
Zpaddler   Zpaddle.base.data_feederr   Zpaddle.base.layer_helperr   Zpaddle.frameworkr   __all__r   r   r   r   r   <module>   s   