o
    soiN                     @  sP   d dl mZ d dlZd dlZd dlmZ d dlmZ dd Z	G dd deZ
dS )	    )annotationsN)Base)expectc                 C  s   t jjd| d|S )N   )p)nprandombinomialastype)xdtype r   Y/home/ubuntu/.local/lib/python3.10/site-packages/onnx/backend/test/case/node/bernoulli.py"bernoulli_reference_implementation   s   r   c                   @  s6   e Zd Zed
ddZed
ddZed
ddZd	S )	BernoullireturnNonec                  C  sN   t jjddgdgd} tjdddt}t|t}t	| |g|gdd	 d S )
Nr   r   y)inputsoutputs              ?
   test_bernoullir   r   name)
onnxhelper	make_noder   r   uniformr
   floatr   r   noder   r   r   r   r   export_bernoulli_without_dtype   s   
z(Bernoulli.export_bernoulli_without_dtypec                  C  sV   t jjddgdgt jjd} tjdddtj	}t
|t}t| |g|gdd	 d S )
Nr   r   r   )r   r   r   r   r   r   test_bernoulli_doubler   )r   r   r   TensorProtoDOUBLEr   r   r   r
   float32r   r    r   r!   r   r   r   export_bernoulli_with_dtype"   s   
z%Bernoulli.export_bernoulli_with_dtypec                  C  s\   t d} tjjddgdg| d}tjdddtj}t	|tj}t
||g|gd	d
 d S )Nr   r   r   r   )r   r   seedr   r   r   test_bernoulli_seedr   )r    r   r   r   r   r   r   r
   r'   r   r   )r)   r"   r   r   r   r   r   export_bernoulli_with_seed/   s   z$Bernoulli.export_bernoulli_with_seedN)r   r   )__name__
__module____qualname__staticmethodr#   r(   r+   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   r   <module>   s   