Skip to content

Commit

Permalink
Merge commit '98ac4542e0e097cd1b26c62d0ffe7fb37230347c'
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Aug 16, 2017
2 parents 0d34a64 + 98ac454 commit 2579b6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions torch/lib/TH/generic/THTensorMath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,10 @@ void THTensor_(max)(THTensor *values_, THLongTensor *indices_, THTensor *t, int
THLongTensor_zero(indices_);

if(t->size[dimension] == 1) {
if (!keepdim) {
THTensor_(squeeze1d)(values_, values_, dimension);
THLongTensor_squeeze1d(indices_, indices_, dimension);
}
return;
}

Expand Down Expand Up @@ -1671,6 +1675,10 @@ void THTensor_(min)(THTensor *values_, THLongTensor *indices_, THTensor *t, int
THLongTensor_zero(indices_);

if(t->size[dimension] == 1) {
if (!keepdim) {
THTensor_(squeeze1d)(values_, values_, dimension);
THLongTensor_squeeze1d(indices_, indices_, dimension);
}
return;
}

Expand Down

0 comments on commit 2579b6b

Please sign in to comment.