diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index c45f1dd0e0ca8e94584ac61c558e66fa596331be..03cc642ae0e26d4d996acb992fa4e2dc29023d24 100644 --- a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py +++ b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py @@ -1338,6 +1338,14 @@ 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]