From 3de79cfeee3160205e686e910a329b2a8b52061c Mon Sep 17 00:00:00 2001 From: Joel Schlosser Date: Sun, 13 Feb 2022 19:32:11 -0800 Subject: [PATCH] Mobile upgrader: add GELU test modules Test Plan: This is test code Reviewed By: tugsbayasgalan Differential Revision: D33858429 fbshipit-source-id: f5bc687ad81125f89cb281f9aa51dc5ac74d6954 (cherry picked from commit 202dff607e72d538c8b3fcd44382d11a401e52c5) --- test/jit/fixtures/test_versioned_gelu_out_v9.ptl | Bin 0 -> 3367 bytes test/jit/fixtures/test_versioned_gelu_v9.ptl | Bin 0 -> 3083 bytes test/jit/fixtures_srcs/fixtures_src.py | 15 +++++++++++++++ test/jit/fixtures_srcs/generate_models.py | 2 ++ 4 files changed, 17 insertions(+) create mode 100644 test/jit/fixtures/test_versioned_gelu_out_v9.ptl create mode 100644 test/jit/fixtures/test_versioned_gelu_v9.ptl diff --git a/test/jit/fixtures/test_versioned_gelu_out_v9.ptl b/test/jit/fixtures/test_versioned_gelu_out_v9.ptl new file mode 100644 index 0000000000000000000000000000000000000000..208ae5100757245d5935bef5b5b3c69ef5faef35 GIT binary patch literal 3367 zcmb_e2~ZPP7+%5=2p)hJwT?PrTENBx0WF8x0)lpeBt?WBk6Aa#CRwt{W-l%WK`lY8 zwWHS7YU@Fz%AnHLQf8|50OTM z8EIuPN855TUqY4)f2@?7X>f-Pw-WL+xq&Dtu_h)bDsj%7pfuuoLPygUrJlCR6>^Qq)*M^c1Ju$x%i0E~i6Cc>8HA&CBf7gHQ?hRq|^PT{Qsa zy#+TB7)wwD&OyDrh;GOF65XEgh~`NvfpI+R;u7p&O5j!?u!MwBagn`Ol?pjLBTt(# zD>*qiDJ3OkmO?Jr$TCde2q>ml$LY-!&B0ZrRxJ%J-xA}j4nPq2X`hIP82@-M;5@Fh zTd1duf3-x9VPXIBz|>e z913v^a7o%on~4cnhmHqpjN~w*Kv9?u1fvvZ4VW2#ijm|AIwnvF9k6dl;_20Z6MoPE zV?jbZnh{zg!(T!`u&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?O!C=ZqD4cS;9sXhLsde_#WLcQT9_Yt}tR3bmBy0NcShlD8H=OzbE_eg+Q2*=?6 khzM*1iGt+{3~)}|YKO%Z44BngbucWm;EWW3{4U=A0L3aNx&QzG literal 0 HcmV?d00001 diff --git a/test/jit/fixtures/test_versioned_gelu_v9.ptl b/test/jit/fixtures/test_versioned_gelu_v9.ptl new file mode 100644 index 0000000000000000000000000000000000000000..5e4ffb20f823518a3730844f81fc515198e0b536 GIT binary patch literal 3083 zcmb_eeNa?Y6n`wRyMQ90sErD;z$g>!0|9|0G)+)hg_W;f<;?5t?%mx7yZiQitso;} z>LR8w+N3s3)F_tHSY~P2#Ps1ujfF<0;y)6^d}=9oHSS?9i8a2H)i%{z1F-E;4` zzjN=ozjMwr86%?zLaQZiYb23JNJx}uFA_wSb0aHlM^2gc7L%w+5*X4Wa8}uZ1e$f* zIDLc2xy$F0#54ETT67K$Y`7U0(iwDCGEq9aFdV=TzbagBNl=h9{A%rfh= z>I^OZ0qx?fcnjx|hSq37b|PA8_TYI>v*h61w3&4?LUV`)EZWQ#*ln;dHXE8jN}OPE zkTx^v;>@fQk+R1wFjlx2RA#4xnPx)3c&f?rGazz{Jm0Q9o>Rs7Sz(uyn{-lH?*&dkrx z&nqe_nwh1O-E0#riwMIsm_>`j$%$B6VKQp8&70FMw?z;H?xwJOND0peDy^U>>WC4k^C|JZ0DYh1L>W3IP9|&1r9Lp1#t5!^>Fo}Vf ztebV)`G|GYc#vsUq;0a(Nt@v%mN9~rb^xPzRi$j^BlY<9d}>BVD`?`5Z$A#A;r4J? zL}q*HMyJxnf?QeXmC(bBP=S|OVXJXqIR%6*ZO;G0r0 z;lRzv&UpHuzuqA zsjHq}c-VF1%%YbDOJXN)dSkEQ$CIaz9bDZzc-ZoB*ZGq1e?M1nRr8a#`+Dle(^kz5 zX4ac|dAmDBq}dyH>KIMrf>dtrIXZ` zE8oG6jha@l_yjnXxNA736Di>x>lP)(Es6e^oOHLG+@{J@qQFJQJOzb-z&(5pNFyE# zXVly*Ash*Qo73)QGq^&usf-$GAs8JFpnJ&z`a5I+JtSZp;5;#%8U=tXI6;st5+q5H zkC;xWVXmgOs=BO_R~aLWs&*}9IeEG#y^<{jNQH5m{$W* zn8(FR?gQ z;}fVkfb_q;$v@&hk`>t)*$F=Zj8jH@Vx_O$5l;azi6(xm&yk>bwHCQWPT&lR^AQH z$csY2;(@ziz#gc2jkFw`vg$)DmqScFOv|_O|43H`XR!2;GrSIg9`+1Dsd6M@FhSEo z5XV6>34<7%2S)-1(=0gzupRz5!T<(XZZfLXS%E#tk=et$ajfAs^xdkE7s@iuPS9YV Yva~zSFXPxX8KZGFggqJp>-%;811cG#$N&HU literal 0 HcmV?d00001 diff --git a/test/jit/fixtures_srcs/fixtures_src.py b/test/jit/fixtures_srcs/fixtures_src.py index 545152b6a3a..dff23702311 100644 --- a/test/jit/fixtures_srcs/fixtures_src.py +++ b/test/jit/fixtures_srcs/fixtures_src.py @@ -42,3 +42,18 @@ def __init__(self): def forward(self, a: Union[int, float, complex], b: Union[int, float, complex], out: torch.Tensor): return torch.logspace(a, b, out=out) + +class TestVersionedGeluV9(torch.nn.Module): + def __init__(self): + super().__init__() + + def forward(self, x): + return torch._C._nn.gelu(x) + +class TestVersionedGeluOutV9(torch.nn.Module): + def __init__(self): + super().__init__() + + def forward(self, x): + out = torch.zeros_like(x) + return torch._C._nn.gelu(x, out=out) diff --git a/test/jit/fixtures_srcs/generate_models.py b/test/jit/fixtures_srcs/generate_models.py index 36b6b5ffe68..980e7dd0324 100644 --- a/test/jit/fixtures_srcs/generate_models.py +++ b/test/jit/fixtures_srcs/generate_models.py @@ -94,6 +94,8 @@ def div_Tensor_0_3(self: Tensor, other: Tensor) -> Tensor: TestVersionedLinspaceOutV7(): "aten::linspace.out", TestVersionedLogspaceV8(): "aten::logspace", TestVersionedLogspaceOutV8(): "aten::logspace.out", + TestVersionedGeluV9(): "aten::gelu", + TestVersionedGeluOutV9(): "aten::gelu.out", } """