diff --git a/testdata/dnn/onnx/data/input_PReLU_slope.npy b/testdata/dnn/onnx/data/input_PReLU_slope.npy new file mode 100644 index 0000000000000000000000000000000000000000..b850fc49b46072258df1fea0d724391acb6e02ab Binary files /dev/null and b/testdata/dnn/onnx/data/input_PReLU_slope.npy differ diff --git a/testdata/dnn/onnx/data/output_PReLU_slope.npy b/testdata/dnn/onnx/data/output_PReLU_slope.npy new file mode 100644 index 0000000000000000000000000000000000000000..e8d0d5d207dbcf9efef4a2e6e6e3ebf93f0a69e3 Binary files /dev/null and b/testdata/dnn/onnx/data/output_PReLU_slope.npy differ diff --git a/testdata/dnn/onnx/generate_onnx_models.py b/testdata/dnn/onnx/generate_onnx_models.py index ab31636aa8ee8f516117d3e9ba4f0cb5e4e45384..8f69df725bd8bb49c7fac6b25a57af8135cef372 100644 --- a/testdata/dnn/onnx/generate_onnx_models.py +++ b/testdata/dnn/onnx/generate_onnx_models.py @@ -136,6 +136,18 @@ input = Variable(torch.randn(1, 2, 10, 10)) relu = nn.ReLU(inplace=True) save_data_and_model("ReLU", input, relu) +class PReLU_slope(nn.Module): + def __init__(self, *args, **kwargs): + super(PReLU_slope, self).__init__() + + def forward(self, x): + return nn.PReLU()(x) + +model = PReLU_slope() +input_ = Variable(torch.randn(1, 1, 5, 5, dtype=torch.float32)) +save_data_and_model("PReLU_slope", input_, model, export_params=True) +simplify('models/PReLU_slope.onnx', False) + input = Variable(torch.randn(2, 3)) dropout = nn.Dropout() diff --git a/testdata/dnn/onnx/models/PReLU_slope.onnx b/testdata/dnn/onnx/models/PReLU_slope.onnx new file mode 100644 index 0000000000000000000000000000000000000000..b0d72218b8b7d1f5fbced9a2d4a29c2203a39d57 Binary files /dev/null and b/testdata/dnn/onnx/models/PReLU_slope.onnx differ