From e3d2bca891439d0383b33d06f5b97054dfa48fef Mon Sep 17 00:00:00 2001 From: SunAhong1993 Date: Tue, 24 Nov 2020 19:29:55 +0800 Subject: [PATCH] fix --- .../caffe_shape.py => decoder/caffe_shape_inference.py} | 4 ++++ x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) rename x2paddle/{op_mapper/dygraph/caffe2paddle/caffe_shape.py => decoder/caffe_shape_inference.py} (99%) diff --git a/x2paddle/op_mapper/dygraph/caffe2paddle/caffe_shape.py b/x2paddle/decoder/caffe_shape_inference.py similarity index 99% rename from x2paddle/op_mapper/dygraph/caffe2paddle/caffe_shape.py rename to x2paddle/decoder/caffe_shape_inference.py index 5368b28..2996233 100644 --- a/x2paddle/op_mapper/dygraph/caffe2paddle/caffe_shape.py +++ b/x2paddle/decoder/caffe_shape_inference.py @@ -83,6 +83,10 @@ def shape_convolution(layer, input_shape): return get_strided_kernel_output_shape(params, input_shape[0], math.floor) +def shape_depthwiseconvolution(layer, input_shape): + return shape_convolution(layer, input_shape) + + def shape_deconvolution(layer, input_shape): h_i = input_shape[0][2] diff --git a/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py index 834d2c9..f78205f 100644 --- a/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/dygraph/onnx2paddle/opset9/opset.py @@ -112,7 +112,7 @@ class OpSet9(): dict(alpha='negative_slope'), dict(negative_slope=.01)], 'Elu': ['paddle.nn.functional.elu', - dict(), + dict(alpha='alpha'), dict(alpha=1.)], 'ThresholdedRelu': ['paddle.nn.functional.thresholded_relu', dict(alpha='threshold'), @@ -121,11 +121,11 @@ class OpSet9(): 'Sigmoid': ['paddle.nn.Sigmoid'], 'Softsign': ['paddle.nn.Softsign'], 'Softplus': ['paddle.nn.Softplus', - dict(), + dict(threshold='threshold'), dict(threshold=float(sys.maxsize))], 'Exp': ['paddle.exp'], 'Softmax': ['paddle.nn.Softmax', - dict(), + dict(axis='axis'), dict(axis=1)], 'Sqrt': ['paddle.sqrt'], 'Floor': ['paddle.floor'], -- GitLab