From 665937e3b0bf792c52c27b3123aaf636eb304ee0 Mon Sep 17 00:00:00 2001 From: jiangjiajun Date: Wed, 12 Aug 2020 03:20:25 +0000 Subject: [PATCH] cast dtype for onnx2paddle: Tile --- x2paddle/op_mapper/onnx2paddle/opset9/opset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 71b51eb..4bbaa13 100644 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -1336,6 +1336,12 @@ class OpSet9(): if repeats is None: repeats = val_repeats.layer_name + if val_repeats.dtype != 'int32': + attr = {"dtype": string("int32")} + node.fluid_code.add_layer( + "cast", inputs=repeats, output="{}.tmp".format(repeats), param_attr=attr) + repeats = "{}.tmp".format(repeats) + elif isinstance(repeats, int): repeats = [repeats] -- GitLab