From 3cf49cbf3dcd471e82c3ec48382db1135fd94ac2 Mon Sep 17 00:00:00 2001 From: SunAhong1993 Date: Thu, 3 Dec 2020 17:55:18 +0800 Subject: [PATCH] fix the expand_dim for numpy 1.17 --- x2paddle/optimizer/tensorflow/prelu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x2paddle/optimizer/tensorflow/prelu.py b/x2paddle/optimizer/tensorflow/prelu.py index 6eba183..c920605 100644 --- a/x2paddle/optimizer/tensorflow/prelu.py +++ b/x2paddle/optimizer/tensorflow/prelu.py @@ -118,5 +118,7 @@ class PReLUOpt: graph.layers[transpose0.id] = transpose0 graph.layers[prelu.id] = prelu graph.layers[transpose1.id] = transpose1 - graph.parameters[alpha.outputs[0]] = np.expand_dims(graph.parameters[alpha.outputs[0]], axis=(0, 2, 3)) + graph.parameters[alpha.outputs[0]] = np.expand_dims(graph.parameters[alpha.outputs[0]], axis=(0)) + graph.parameters[alpha.outputs[0]] = np.expand_dims(graph.parameters[alpha.outputs[0]], axis=(2)) + graph.parameters[alpha.outputs[0]] = np.expand_dims(graph.parameters[alpha.outputs[0]], axis=(3)) graph.build() \ No newline at end of file -- GitLab