Skip to content

Commit 7e5e018

Browse files
lingebengpytorchmergebot
authored andcommitted
[Fix] Fix logic error in dimension check (redundant check on mat2) (#171791)
Fix logic error in dimension check (redundant check on mat2) Pull Request resolved: #171791 Approved by: https://github.com/malfet
1 parent 83fde9d commit 7e5e018

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

aten/src/ATen/native/mkldnn/Matmul.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static inline bool checksize(const Tensor& mat1, const Tensor& mat2){
423423
} else if (mat1.dim() == 2 && mat2.dim() == 1) {
424424
// aten::mv
425425
return mat1.size(0) * mat1.size(1) > mkldnn_gemm_min_size;
426-
} else if (mat2.dim() == 2 && mat2.dim() == 2) {
426+
} else if (mat1.dim() == 2 && mat2.dim() == 2) {
427427
// aten::addmm
428428
return mat1.size(0) * mat1.size(1) * mat2.size(1) > mkldnn_gemm_min_size;
429429
} else {

0 commit comments

Comments
 (0)