From 6a6e4d8d0f3957bca58a0a7f26ffaf3e2c4dee11 Mon Sep 17 00:00:00 2001 From: xuwei06 Date: Fri, 10 Nov 2017 17:59:57 -0800 Subject: [PATCH] Fix matmal_op for debug mode The dimension is not set correctly and is not being checked in release mode because eigen_assert is not enabled. --- paddle/operators/matmul_op.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/paddle/operators/matmul_op.h b/paddle/operators/matmul_op.h index 5ce30740c..4f565946d 100644 --- a/paddle/operators/matmul_op.h +++ b/paddle/operators/matmul_op.h @@ -74,11 +74,10 @@ Tensor CombineBatchAndN(const framework::ExecutionContext& context, Tensor output; auto in_dims = input.dims(); if (in_dims.size() == 3) { - output.Resize(in_dims); + output.Resize({in_dims[1], in_dims[0], in_dims[2]}); output.mutable_data(context.GetPlace()); EigenTranspose(context, input, output, {1, 0, 2}); - std::vector out_dims = {in_dims[1], in_dims[0] * in_dims[2]}; - output.Resize(make_ddim(out_dims)); + output.Resize({in_dims[1], in_dims[0] * in_dims[2]}); } else { output.ShareDataWith(input); } -- GitLab