From c9b1ececfdbfd430e688eadc4ae940c16ff6675d Mon Sep 17 00:00:00 2001 From: Liubov Batanina Date: Fri, 15 Jan 2021 14:01:02 +0300 Subject: [PATCH] Added test data for Mish ONNX subgraph --- testdata/dnn/onnx/data/input_mish.npy | Bin 0 -> 160 bytes testdata/dnn/onnx/data/output_mish.npy | Bin 0 -> 160 bytes testdata/dnn/onnx/generate_onnx_models.py | 10 +++++++++- testdata/dnn/onnx/models/mish.onnx | 21 +++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 testdata/dnn/onnx/data/input_mish.npy create mode 100644 testdata/dnn/onnx/data/output_mish.npy create mode 100644 testdata/dnn/onnx/models/mish.onnx diff --git a/testdata/dnn/onnx/data/input_mish.npy b/testdata/dnn/onnx/data/input_mish.npy new file mode 100644 index 0000000000000000000000000000000000000000..75cc37ef63924f34876b567377f86098210fe9f4 GIT binary patch literal 160 zcmbR27wQ`j$;eQ~P_3SlTAW;@Zl$1ZlV+l>qoAIaUsO_*m=~X4l#&V(cT3DEP6dh= zXCxM+0{I$-ItoS*q^YA&t3U?entE-iovh=%y}XIxcD*tu_T8UTVAtfQW&dW$7Q1s? GmG%JA3o4TU literal 0 HcmV?d00001 diff --git a/testdata/dnn/onnx/data/output_mish.npy b/testdata/dnn/onnx/data/output_mish.npy new file mode 100644 index 0000000000000000000000000000000000000000..af3db1e2f685b1d41c5ff3711ab37be8a03ddeb1 GIT binary patch literal 160 zcmbR27wQ`j$;eQ~P_3SlTAW;@Zl$1ZlV+l>qoAIaUsO_*m=~X4l#&V(cT3DEP6dh= zXCxM+0{I$-ItoS*q^YA&t3U?e$_>o0`)yji_ih!xU6z*JzGqTOc3cwd_Ok^V?3DGx F>;b3PCcXdw literal 0 HcmV?d00001 diff --git a/testdata/dnn/onnx/generate_onnx_models.py b/testdata/dnn/onnx/generate_onnx_models.py index 167b131aa..bc7732d2f 100644 --- a/testdata/dnn/onnx/generate_onnx_models.py +++ b/testdata/dnn/onnx/generate_onnx_models.py @@ -1224,4 +1224,12 @@ def forward(self, x): x = Variable(torch.randn(1, 2, 20, 20)) model = Conv1ResizePoold() -save_data_and_model("conv_resize_pool_1d", x, model) \ No newline at end of file +save_data_and_model("conv_resize_pool_1d", x, model) + +class Mish(nn.Module): + def forward(self, x): + return x * (torch.tanh(F.softplus(x))) + +x = Variable(torch.randn([1, 2, 2, 2])) +model = Mish() +save_data_and_model("mish", x, model) diff --git a/testdata/dnn/onnx/models/mish.onnx b/testdata/dnn/onnx/models/mish.onnx new file mode 100644 index 000000000..43f4ac284 --- /dev/null +++ b/testdata/dnn/onnx/models/mish.onnx @@ -0,0 +1,21 @@ +pytorch1.7:� + +01 +Softplus_0"Softplus + +12Tanh_1"Tanh + +0 +23Mul_2"Multorch-jit-exportZ +0 + + + + +b +3 + + + + +B \ No newline at end of file