U
    9%e8                     @   sx   d dl mZmZ d dlmZmZ eeef edddZedZ	eeef e
dddZeeef eed	d
ddZd	S )    )DictUnion)NativeFunctionsGroupNativeFunctionsViewGroup)greturnc                 C   s,   t | trt| jjjjjS t| jjS d S N)	
isinstancer   strZ
functionalfuncnamebaseviewZ	root_name)r    r   ]/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/torchgen/static_runtime/config.pyfunc_name_base_str   s    
r   )'absaddZaddmmallanyZargminZbmmclampZ	clamp_minZcumsumdivfmodZindex_selectZ
leaky_reluZlinearlogmatmulmulZnarrow_copyZnonzeropow	remainderZsigmoidsignsubtanhdetachZ	expand_asflattenZnarrowZ
reshape_asselectsliceZsoftmaxsplitZsqueezeZ	transposer   wherec                 C   s   t | }|tkS r   )r   is_hand_written_ops_)r   Z	name_baser   r   r   is_hand_written:   s    r(   N)arg_mapop_nameindexr   c                 C   s 	  |dks|dkst |dkrZ|dkr>d| d< d| d< d| d< nd	| d< d
| d< d
| d< d S |dkr|dkr|d| d< d| d< nd	| d< d
| d< d S |dkr|dkrd| d< nd	| d< d S |dkr|dkrd| d< d| d< nd| d< d| d< d S |dkr|dkr
d| d< nd| d< d S |dkr@|dkr4d| d< nd| d< d S |dkrj|dkr^d| d< nd| d< d S |dkr|dkrd| d< nd	| d< d S |d kr|dkrd| d< nd	| d< d S |d!kr|dkrd| d"< d#| d$< nd
| d"< d#| d$< d S |d%kr2|dkrd| d"< d#| d$< nd
| d"< d#| d$< d S |d&kr||dkr`d| d< d'| d(< d| d)< nd	| d< d*| d(< d
| d)< d S |d+kr|dkrd| d< d,| d(< nd	| d< d-| d(< d S |d.kr |dkrd| d< d'| d(< d| d)< nd	| d< d*| d(< d
| d)< d S |d/krJ|dkr.d0| d< d1| d(< d| d)< nd2| d< d3| d(< d
| d)< d S |d4kr`d5| d6< d S |d7kr|dkrd0| d< d8| d9< nd2| d< d8| d9< d S |d:kr|dkrd;| d< d<| d=< d;| d< nd>| d< d?| d=< d>| d< d S |d@kr|dkrdA| d< ndB| d< d S |dCkrX|dkr<dD| dE< dD| d< dF| d< ndG| dE< dG| d< dH| d< d S |dIkr|dkrdJ| dE< dJ| d< dK| d< ndL| dE< dL| d< dM| d< d S |dNkr|dkrdO| d< dP| d< ndQ| d< dR| d< d S |dSkr|dkrdT| d< dU| d< ndV| d< dW| d< d S |dXkrp|dkrLdY| d< dZ| d[< d\| d< d]| d^< n d_| d< dZ| d[< d`| d< d]| d^< d S |dakr|dkrdb| d< dc| dd< nde| d< dc| dd< d S |dfkr|dkrdb| dE< db| d< dc| dd< nde| dE< de| d< dc| dd< d S |dgkr^|dkr2d;| d< dh| d[< di| d< d;| dj< d8| dk< n(dl| d< dh| d[< dm| d< dl| dj< d8| dk< d S |dnkr|dkrd;| d< dh| d[< do| d< d;| dj< n dp| d< dh| d[< dq| d< dp| dj< d S |drkr|dkrds| d< ds| d< dZ| d[< nd| d< d| d< dZ| d[< d S |dtkr|dkrPdu| dE< d| d< dv| d(< d| d)< dZ| dw< dZ| dx< du| dy< n8du| dE< dz| d< d{| d(< dz| d)< dZ| dw< dZ| dx< du| dy< d S |d|kr|dkrd}| d< d\| d< d}| d~< nd| d< d| d< d| d~< d| kr|dkrdnd| d< d S |dkr(d| d< |dkrd1| d< nd3| d< d S |dkrb|dkrNd| d< d| d< nd| d< d| d< d S |dkr|dkrd| d< d| d< d]| d< nd| d< d| d< d]| d< d S |dkr|dkrd| d< d| d< d]| d< nd| d< d| d< d]| d< d S |dk	rdh| d< dZ| d< d8| d< d S d S )Nr      addrzat::rand({6, 6})selfzat::rand({6})Zvec1Zvec2zat::rand({22, 22})zat::rand({22})mvZvecZaddbmmcrosszat::rand({3, 3, 3})otherzat::rand({22, 3, 22})Ztakez(at::randint(0, 216, {20}, torch::kInt64)r+   z*at::randint(0, 1000, {100}, torch::kInt64)Ztake_along_dimzat::argsort(self0, 1, true)indiceszat::argsort(self1, 1, true)Zmasked_selectzat::randn({6, 6, 6}) > 0.5maskzat::rand({22, 22, 22}) > 0.5ZorgqrZinput2ZormqrZquantileqz"linear"interpolationZnanquantileZmulti_margin_lossz"at::randint(6, {6}, torch::kInt64)targetweightz$at::randint(22, {22}, torch::kInt64)Zmultilabel_margin_lossz%at::randint(6, {6, 6}, torch::kInt64)z(at::randint(22, {22, 22}, torch::kInt64)Znll_lossZ
nll_loss2dzat::rand({6, 6, 6, 6})z(at::randint(6, {6, 6, 6}, torch::kInt64)zat::rand({22, 22, 22, 22})z,at::randint(22, {22, 22, 22}, torch::kInt64))Zfft_fftZfft_ifftZfft_rfftZ	fft_irfftZfft_hfftZ	fft_ihfftz	"forward"ZnormZlinalg_tensorinv2indZaddmvzat::rand({2})zat::rand({2, 2})matzat::rand({35})zat::rand({35, 35})acoshz)at::rand({2, 2, 2}) + at::ones({2, 2, 2})z)at::rand({5, 5, 5}) + at::ones({5, 5, 5})Zadaptive_max_pool2d_backwardzat::rand({2, 2, 2}, at::kFloat)Zgrad_outputz'at::randint(0, 1, {2, 2, 2}, at::kLong)zat::rand({3, 3, 3}, at::kFloat)z'at::randint(0, 1, {3, 3, 3}, at::kLong)Zadaptive_max_pool3d_backwardz"at::rand({2, 2, 2, 2}, at::kFloat)z*at::randint(0, 1, {2, 2, 2, 2}, at::kLong)z"at::rand({3, 3, 3, 3}, at::kFloat)z*at::randint(0, 1, {3, 3, 3, 3}, at::kLong)Zbitwise_left_shiftz+at::randint(1, 1 << 4, {6, 6, 6}, at::kInt)z'at::randint(1, 26, {6, 6, 6}, at::kInt)z.at::randint(1, 1 << 4, {22, 22, 22}, at::kInt)z*at::randint(1, 26, {22, 22, 22}, at::kInt)Zbitwise_right_shiftz2at::randint(1 << 21, 1 << 30, {6, 6, 6}, at::kInt)z'at::randint(1, 22, {6, 6, 6}, at::kInt)z5at::randint(1 << 21, 1 << 30, {22, 22, 22}, at::kInt)z*at::randint(1, 22, {22, 22, 22}, at::kInt)gatherz&at::randint(1, 100, {2,2,2}, at::kInt)1dimz)at::randint(0, 1, {2,2,2}, torch::kInt64)falseZsparse_gradz&at::randint(1, 100, {5,5,5}, at::kInt)z)at::randint(0, 4, {5,5,5}, torch::kInt64)Zgeluzat::rand({6, 6, 6})z"tanh"Zapproximatezat::rand({22, 22, 22})Zgelu_backwardZ	index_add0z at::randint(0, 1, {2}, at::kInt)sourcealphazat::rand({16})z"at::randint(0, 10, {16}, at::kInt)Z
index_copyz!at::randint(0, 1, {2}, at::kLong)zat::rand({32})z#at::randint(0, 10, {32}, at::kLong)Zlinalg_crosszat::rand({6, 3, 6})Znll_loss_backwardzat::rand({})z%at::randint(0, 5, {6}, torch::kInt64)Z	reductionZignore_indexZtotal_weightzat::rand({36})z'at::randint(0, 11, {36}, torch::kInt64))ZscatterZscatter_add_scatter_reducez+at::randint(1, 100, {2,2,2}, torch::kInt64)srcz+at::randint(1, 100, {5,5,5}, torch::kInt64)z)at::randint(0, 1, {5,5,5}, torch::kInt64)reducerC   z"sum"z"add"Zscatter_reducez"mean"Zspecial_zetaz2at::rand({2,2,2}, at::kDouble) + at::ones({2,2,2})z2at::rand({5,5,5}, at::kDouble) + at::ones({5,5,5})Z _convert_indices_from_csr_to_cooz!torch::tensor({1}, torch::kInt32)Zcrow_indicesz'torch::tensor({0, 1, 0}, torch::kInt32)Zcol_indicesZ	out_int32z!torch::tensor({0}, torch::kInt32)zBtorch::tensor({0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2}, torch::kInt32)Z _convert_indices_from_coo_to_csrz at::randint(0, 3, {2}, at::kInt)10sizez!at::randint(0, 3, {12}, at::kInt)Z24)ZdiagonalZlinalg_diagonaloffsetZdim0Zdim1)AssertionError)r)   r*   r+   r   r   r   override_test_values?   s:   
































































































rJ   )typingr   r   Ztorchgen.modelr   r   r
   r   	frozensetr'   boolr(   intrJ   r   r   r   r   <module>   s   -