From f4b1d1dac9c153610d34d74291c4e6f2b9d64392 Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Mon, 10 Aug 2020 02:22:14 +0000 Subject: [PATCH] add cast for paddle2onnx --- x2paddle/op_mapper/paddle2onnx/opset9/opset.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x2paddle/op_mapper/paddle2onnx/opset9/opset.py b/x2paddle/op_mapper/paddle2onnx/opset9/opset.py index 89c6525..15ddf93 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset9/opset.py +++ b/x2paddle/op_mapper/paddle2onnx/opset9/opset.py @@ -802,6 +802,14 @@ class OpSet9(object): axes=op.attr('axes')) return node + def cast(self, op, block): + node = helper.make_node( + 'Cast', + inputs=op.input('X'), + outputs=op.output('Out'), + to=self.paddle_onnx_dtype_map[op.attr('out_dtype')]) + return node + def arg_max(self, op, block): node = helper.make_node( 'ArgMax', -- GitLab