Skip to content

Commit f78a266

Browse files
committed
Merge commit '368cbe615d0a7bdaadddcb3bd390abcd4cc17b91'
2 parents f096fb6 + 368cbe6 commit f78a266

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

torch/lib/TH/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ IF(POLICY CMP0026)
66
ENDIF()
77

88
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
9+
SET(CMAKE_LIBRARY_PATH /usr/lib/x86_64-linux-gnu/ ${CMAKE_LIBRARY_PATH})
910

1011
# Can be compiled standalone
1112
IF(NOT TH_INSTALL_BIN_SUBDIR

torch/lib/TH/generic/THTensorMath.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -2074,10 +2074,6 @@ void THTensor_(catArray)(THTensor *result, THTensor **inputs, int numInputs, int
20742074
// accumulate the size over the dimension we want to cat on.
20752075
// Empty tensors are allowed
20762076
dimSize += i < inputs[j]->nDimension ? inputs[j]->size[i] : THMin(inputs[j]->nDimension, 1);
2077-
if(inputs[j]->nDimension)
2078-
{
2079-
allContiguous = allContiguous && THTensor_(isContiguous)(inputs[j]);
2080-
}
20812077
}
20822078
}
20832079
else
@@ -2108,6 +2104,12 @@ void THTensor_(catArray)(THTensor *result, THTensor **inputs, int numInputs, int
21082104
{
21092105
THTensor_(resize)(result, size, NULL);
21102106

2107+
// Check contiguity of all inputs and result
2108+
for (i = 0; i < numInputs; i++) {
2109+
if(inputs[i]->nDimension) {
2110+
allContiguous = allContiguous && THTensor_(isContiguous)(inputs[i]);
2111+
}
2112+
}
21112113
allContiguous = allContiguous && THTensor_(isContiguous)(result);
21122114

21132115
// First path is for contiguous inputs along dim 1

0 commit comments

Comments
 (0)