Skip to content

Commit 6a6e4d8

Browse files
author
xuwei06
committed
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.
1 parent 3971586 commit 6a6e4d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

paddle/operators/matmul_op.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ Tensor CombineBatchAndN(const framework::ExecutionContext& context,
7474
Tensor output;
7575
auto in_dims = input.dims();
7676
if (in_dims.size() == 3) {
77-
output.Resize(in_dims);
77+
output.Resize({in_dims[1], in_dims[0], in_dims[2]});
7878
output.mutable_data<T>(context.GetPlace());
7979
EigenTranspose<Place, T, 3>(context, input, output, {1, 0, 2});
80-
std::vector<int64_t> out_dims = {in_dims[1], in_dims[0] * in_dims[2]};
81-
output.Resize(make_ddim(out_dims));
80+
output.Resize({in_dims[1], in_dims[0] * in_dims[2]});
8281
} else {
8382
output.ShareDataWith(input);
8483
}

0 commit comments

Comments
 (0)