From 3552bf7c01e3945a3fb61895f6477c6eb90ad652 Mon Sep 17 00:00:00 2001 From: Wang Huan Date: Wed, 27 Nov 2024 10:37:39 +0000 Subject: [PATCH 1/3] fix bug --- paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h index c4ad2a474f9e6..833be0e82335d 100644 --- a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h +++ b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h @@ -1726,10 +1726,10 @@ void tile_grad(const Tensor& x, expand_shape_vec.size() <= 8) { auto repeat = repeat_times_data.back(); auto orig_size = - cast(out_grad_shape_vec.back() / repeat, DataType::INT32); + cast(out_grad_shape_vec.back() / repeat, DataType::INT64); size_t out_grad_last_index = out_grad_shape_vec.size() - 1; expand_shape_vec[out_grad_last_index] = - full({1}, repeat, DataType::INT32); + full({1}, repeat, DataType::INT64); expand_shape_vec.insert( expand_shape_vec.begin() + out_grad_shape_vec.size(), orig_size); From a8a8a3b048d801e413ed8da36cc14c9f4cb92cad Mon Sep 17 00:00:00 2001 From: Wang Huan Date: Wed, 27 Nov 2024 11:16:00 +0000 Subject: [PATCH 2/3] refine --- paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h index 833be0e82335d..d8120995692d6 100644 --- a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h +++ b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h @@ -1773,7 +1773,7 @@ void tile_grad(const Tensor& x, int64_t orig_size = out_grad_shape.back() / repeat; size_t out_grad_last_index = out_grad_shape.size() - 1; - // Reshape the corresponding dimension to be `repeat` multiplied by + // reshape the corresponding dimension to be `repeat` multiplied by // `orig_size`. expand_shape[out_grad_last_index] = repeat; expand_shape.insert( From 89652993ff98ec634873b397939e0e54bf657ed9 Mon Sep 17 00:00:00 2001 From: Wang Huan Date: Wed, 27 Nov 2024 11:16:36 +0000 Subject: [PATCH 3/3] refine --- paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h index d8120995692d6..833be0e82335d 100644 --- a/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h +++ b/paddle/fluid/primitive/decomp_rule/decomp_vjp/details.h @@ -1773,7 +1773,7 @@ void tile_grad(const Tensor& x, int64_t orig_size = out_grad_shape.back() / repeat; size_t out_grad_last_index = out_grad_shape.size() - 1; - // reshape the corresponding dimension to be `repeat` multiplied by + // Reshape the corresponding dimension to be `repeat` multiplied by // `orig_size`. expand_shape[out_grad_last_index] = repeat; expand_shape.insert(