From 3d62c6dac48863cb0685d526b7c44b80aa3d5caa Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Wed, 6 Sep 2017 11:50:48 -0700 Subject: [PATCH] Fix bug --- paddle/framework/ddim.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/paddle/framework/ddim.cc b/paddle/framework/ddim.cc index 0e2cd3acc..58e20625c 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 -- GitLab