diff --git a/x2paddle/op_mapper/onnx2paddle/opset9/opset.py b/x2paddle/op_mapper/onnx2paddle/opset9/opset.py index 71b51eb0f1037c6a51cc431d884414ba44a7fc25..4bbaa134103a4336f9cfcfdae8dde64192a291ff 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]