diff --git a/paddle/framework/ddim.cc b/paddle/framework/ddim.cc index 0e2cd3acc8b5931ef9c7c654e504be29df170013..58e20625ce7a3d71e4fc59dc5478539eecd6b88c 100644 --- a/paddle/framework/ddim.cc +++ b/paddle/framework/ddim.cc @@ -288,14 +288,11 @@ DDim::DDim(std::initializer_list init_list) { // will be the product of tensor's first `num_col_dims` dimensions DDim flatten_to_2d(const DDim& src, int num_col_dims) { int rank = src.size(); - return make_ddim( - {static_cast(product(slice_ddim(src, 0, num_col_dims))), - static_cast(product(slice_ddim(src, num_col_dims, rank)))}); + return make_ddim({product(slice_ddim(src, 0, num_col_dims)), + product(slice_ddim(src, num_col_dims, rank))}); } -DDim flatten_to_1d(const DDim& src) { - return make_ddim({static_cast(product(src))}); -} +DDim flatten_to_1d(const DDim& src) { return make_ddim({product(src)}); } } // namespace framework } // namespace paddle