U
    <ºc8  ã                   @   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ÚviewÚ	root_name)r   © r   úB/tmp/pip-unpacked-wheel-gikjz4vx/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rªd| d< n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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rˆd| d< nd	| d< d S |d kr¾|dkr²d| d< nd	| d< d S |d!krø|dkräd| 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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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r†d0| d< d8| d9< nd2| d< d8| d9< 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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r†dJ| dE< dJ| d< dK| d< ndL| dE< dL| d< dM| d< d S |dNkrÜ|dkrÈdO| 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r–db| d< dc| dd< nde| d< dc| dd< d S |dfkrô|dkrØdb| 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r”d;| d< dh| d[< do| d< d;| dj< n dp| d< dh| d[< dq| d< dp| dj< d S |drkr|dkræds| 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rºd}| d< d\| d< d}| d~< nd| d< d€| d< d| d~< d| krò|d‚krêdƒnd„| d< d S |d…kr(d†| d< |dkrd1| d< nd3| d< d S |d‡krb|dkrNdˆ| 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rö|dkrÚd“| d< d”| d•< d]| d< nd–| d< d—| d•< d]| d< d S |d˜k	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addbmmZ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)ÚtargetZ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)Zgatherz&at::randint(1, 100, {2,2,2}, at::kInt)Ú1Z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)Úreducer@   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:   




























































































þÿ



rG   )Útypingr   r   Ztorchgen.modelr   r   r
   r   Ú	frozensetr(   Úboolr)   ÚintrG   r   r   r   r   Ú<module>   s   ÿ-