From f5bf46e6a3da6c780931db7aefad8addd40f4ff0 Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Wed, 16 Mar 2022 17:07:37 +0800 Subject: [PATCH] Fix tile_op inferShape (#40589) * Fix tile_op inferShape * fix style --- paddle/phi/ops/compat/tile_sig.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/phi/ops/compat/tile_sig.cc b/paddle/phi/ops/compat/tile_sig.cc index 49a6d02225d..ca3fa5fe1f8 100644 --- a/paddle/phi/ops/compat/tile_sig.cc +++ b/paddle/phi/ops/compat/tile_sig.cc @@ -20,6 +20,11 @@ KernelSignature TileOpArgumentMapping(const ArgumentMappingContext& ctx) { if (ctx.HasInput("RepeatTimes")) { return KernelSignature("tile", {"X"}, {"RepeatTimes"}, {"Out"}); } else if (ctx.InputSize("repeat_times_tensor") > 0) { + const auto& repeat_times = + paddle::any_cast>(ctx.Attr("repeat_times")); + if (!ctx.IsRuntime() && !repeat_times.empty()) { + return KernelSignature("tile", {"X"}, {"repeat_times"}, {"Out"}); + } return KernelSignature("tile", {"X"}, {"repeat_times_tensor"}, {"Out"}); } else { return KernelSignature("tile", {"X"}, {"repeat_times"}, {"Out"}); -- GitLab