o
    soi
                     @  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                   @  sR   e Zd ZedddZedddZedddZedd	d
ZedddZdS )	UnsqueezereturnNonec                  C  s   t jdddt j} t| jD ].}t |gt j}t	j
jdddgdgd}t j| |d	}t|| |g|gd
t| d qd S )N         r   xaxesyinputsoutputsaxistest_unsqueeze_axis_r   r   name)nprandomrandnastypefloat32rangendimarrayint64onnxhelper	make_nodeexpand_dimsr   str)r   ir   noder    r&   Y/home/ubuntu/.local/lib/python3.10/site-packages/onnx/backend/test/case/node/unsqueeze.pyexport_unsqueeze_one_axis   s    
z#Unsqueeze.export_unsqueeze_one_axisc                  C  s|   t jdddt j} t ddgt j}tjj	dddgdgd	}t j
| dd
}t j
|dd
}t|| |g|gdd d S )Nr   r	   r
      r   r   r   r   r   r   test_unsqueeze_two_axesr   r   r   r   r   r   r   r   r   r    r!   r"   r   r   r   r%   r   r&   r&   r'   export_unsqueeze_two_axes"   s   z#Unsqueeze.export_unsqueeze_two_axesc                  C     t jdddt j} t g dt j}tjj	dddgdgd	}t j
| d
d}t j
|dd}t j
|dd}t|| |g|gdd d S )Nr   r	   r
   )   r	   r
   r   r   r   r   r   r/   r   test_unsqueeze_three_axesr   r+   r,   r&   r&   r'   export_unsqueeze_three_axes1      z%Unsqueeze.export_unsqueeze_three_axesc                  C  r.   )Nr   r	   r
   )r
   r	   r/   r   r   r   r   r   r/   r   test_unsqueeze_unsorted_axesr   r+   r,   r&   r&   r'   export_unsqueeze_unsorted_axesA   r2   z(Unsqueeze.export_unsqueeze_unsorted_axesc                  C  sn   t jjdddgdgd} tjddddtj}td	gtj	}tj
|d	d
}t| ||g|gdd d S )Nr   r   r   r   r   r)   r   r
   r   test_unsqueeze_negative_axesr   )r   r    r!   r   r   r   r   r   r   r   r"   r   )r%   r   r   r   r&   r&   r'   export_unsqueeze_negative_axesQ   s   z(Unsqueeze.export_unsqueeze_negative_axesN)r   r   )	__name__
__module____qualname__staticmethodr(   r-   r1   r4   r7   r&   r&   r&   r'   r      s    r   )

__future__r   numpyr   r   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r&   r&   r&   r'   <module>   s   