U
    rhJ	                     @  sH   d dl mZ d dlZd dlZd dlmZ d dlmZ G dd deZ	dS )    )annotationsN)Base)expectc                   @  sT   e Zd ZeddddZeddddZeddddZeddd	d
ZdS )GatherNone)returnc                  C  sv   t jjdddgdgdd} tjddd	d
tj}tddd	g}tj	||dd}t
| ||tjg|gdd d S )Nr   dataindicesyr   inputsoutputsaxis               r   Ztest_gather_0r   r   nameonnxhelper	make_nodenprandomZrandnastypefloat32arraytaker   int64noder   r	   r
    r$   F/tmp/pip-unpacked-wheel-xnis5xre/onnx/backend/test/case/node/gather.pyexport_gather_0   s    zGather.export_gather_0c                  C  sv   t jjdddgdgdd} tjddd	d
tj}tddd	g}tj	||dd}t
| ||tjg|gdd d S )Nr   r   r	   r
   r   r   r   r   r   r   r   r   Ztest_gather_1r   r   r"   r$   r$   r%   export_gather_1!   s    zGather.export_gather_1c                  C  sr   t jjdddgdgdd} tjddtj}tdd	gg}tj	||dd
}t
| ||tjg|gdd d S )Nr   r   r	   r
   r   r   r   r   r   r   Ztest_gather_2d_indicesr   r   r"   r$   r$   r%   export_gather_2d_indices4   s    zGather.export_gather_2d_indicesc                  C  sn   t jjdddgdgdd} tdtj}tddd	g}tj||dd
}t	| ||tj
g|gdd d S )Nr   r   r	   r
   r   r   
   iir   Ztest_gather_negative_indicesr   )r   r   r   r   Zaranger   r   r   r    r   r!   r"   r$   r$   r%   export_gather_negative_indicesG   s    z%Gather.export_gather_negative_indicesN)__name__
__module____qualname__staticmethodr&   r'   r(   r*   r$   r$   r$   r%   r      s   r   )

__future__r   Znumpyr   r   Zonnx.backend.test.case.baser   Zonnx.backend.test.case.noder   r   r$   r$   r$   r%   <module>   s
   