diff --git a/paddle/fluid/operators/matmul_v2_op.h b/paddle/fluid/operators/matmul_v2_op.h index c5ecec60a963c951a8aaf3d82255ff16f4838144..2fa1ebdeecf7cc684113ec7b50e66409e025cbb3 100644 --- a/paddle/fluid/operators/matmul_v2_op.h +++ b/paddle/fluid/operators/matmul_v2_op.h @@ -432,7 +432,7 @@ static void ReshapeXYOutIntoMatrixSequence(framework::Tensor* x, if (mat_dim_x.batch_size_ == 0 && mat_dim_y.batch_size_ == 0) { out->Resize({mat_dim_x.height_, mat_dim_y.width_}); } else { - out->Resize({std::max(mat_dim_x.batch_size_, mat_dim_y.batch_size_), + out->Resize({(std::max)(mat_dim_x.batch_size_, mat_dim_y.batch_size_), mat_dim_x.height_, mat_dim_y.width_}); }