diff --git a/libnd4j/blas/NDArray.h b/libnd4j/blas/NDArray.h index 5ce4f33d4..be82cf3f8 100644 --- a/libnd4j/blas/NDArray.h +++ b/libnd4j/blas/NDArray.h @@ -1702,7 +1702,7 @@ bool NDArray::isSameShape(const std::vector& shape) const{ if (this->rankOf() != (int) shape.size()) return false; for (int e = 0; e < this->rankOf(); e++) { - if (this->shapeOf()[e] != shape.at(e) && shape.at(e) != -1) + if (this->shapeOf()[e] != shape[e] && shape[e] != -1) return false; } return true; diff --git a/libnd4j/blas/NDArray.hpp b/libnd4j/blas/NDArray.hpp index d6211c1d4..46cc1ab21 100644 --- a/libnd4j/blas/NDArray.hpp +++ b/libnd4j/blas/NDArray.hpp @@ -980,7 +980,7 @@ std::string NDArray::asString(Nd4jLong limit) { template std::vector NDArray::getBufferAsVector() { std::vector vector(lengthOf()); - for (int e = 0; e < lengthOf(); e++) + for (Nd4jLong e = 0; e < lengthOf(); e++) vector[e] = this->e(e); return vector; } @@ -2128,12 +2128,12 @@ bool NDArray::isIdentityMatrix() { throw std::runtime_error("isIdentityMatrix method: matrix must be square and have rank = 2 !"); const double eps = 1e-5f; - for(int i=0; i(i,i) - 1.f) > eps) return false; - for(int i=0; i(i,j)) > eps) @@ -2335,7 +2335,7 @@ NDArray NDArray::asS() const { Nd4jLong dataLength = 0; auto data = bufferAsT() + offsetsLength; - for (int e = 0; e < lengthOf(); e++) { + for (Nd4jLong e = 0; e < lengthOf(); e++) { offsets[e] = dataLength; start = nInputoffsets[e]; stop = nInputoffsets[e + 1]; @@ -3524,7 +3524,7 @@ bool NDArray::equalsTo(const NDArray *other, double eps) const { // string is special case, we'll compare them one by one, considering both arrays are guaranteed to have the same length if (dataType() == DataType::UTF8) { - for (int e = 0; e < this->lengthOf(); e++) { + for (Nd4jLong e = 0; e < this->lengthOf(); e++) { auto s1 = this->e(e); auto s2 = other->e(e); @@ -3533,7 +3533,7 @@ bool NDArray::equalsTo(const NDArray *other, double eps) const { } } else if (dataType() == DataType::UTF16) { - for (int e = 0; e < this->lengthOf(); e++) { + for (Nd4jLong e = 0; e < this->lengthOf(); e++) { auto s1 = this->e(e); auto s2 = other->e(e); @@ -3542,7 +3542,7 @@ bool NDArray::equalsTo(const NDArray *other, double eps) const { } } else { - for (int e = 0; e < this->lengthOf(); e++) { + for (Nd4jLong e = 0; e < this->lengthOf(); e++) { auto s1 = this->e(e); auto s2 = other->e(e); @@ -4801,7 +4801,7 @@ ResultSet NDArray::allTensorsAlongDimension(const std::vector &dimensions) auto pack = ConstantTadHelper::getInstance()->tadForDimensions(_shapeInfo, const_cast(dimensions.data()), dimensions.size()); auto numTads = pack.numberOfTads(); - for (int idx = 0; idx < numTads; idx++ ) { + for (Nd4jLong idx = 0; idx < numTads; idx++ ) { auto array = new NDArray(_buffer, ShapeDescriptor(pack.primaryShapeInfo()), getContext(), pack.primaryOffsets()[idx] + getBufferOffset()); array->_isView = true; result.push_back(array); @@ -4872,7 +4872,7 @@ NDArray NDArray::operator()(const std::vector& idx, const bool keepUni std::vector dimsWithUnities; - for (uint d = 0; d < rank; ++d) + for (int d = 0; d < rank; ++d) if(idx[n*d] != idx[n*d+1] && shapeOf[d] == 1) dimsWithUnities.push_back(d); diff --git a/libnd4j/blas/cpu/NDArray.cpp b/libnd4j/blas/cpu/NDArray.cpp index 58d4b3c34..efae00ea6 100644 --- a/libnd4j/blas/cpu/NDArray.cpp +++ b/libnd4j/blas/cpu/NDArray.cpp @@ -308,7 +308,7 @@ void NDArray::tile(const std::vector& reps, NDArray& target) const { // fill newBuff, loop through all elements of newBuff // looping through _buffer goes automatically by means of getSubArrayIndex applying const int ews = target.ews(); - const int targetLen = target.lengthOf(); + const auto targetLen = target.lengthOf(); if(target.ordering() == 'c' && ews == 1) { // ews == 1 always here //#pragma omp parallel for simd if(targetLen > Environment::getInstance()->elementwiseThreshold()) schedule(guided) for(Nd4jLong i=0; i= 1 && zEWS >= 1) { PRAGMA_OMP_SIMD - for (int i = 0; i < tadLength; i++) { + for (Nd4jLong i = 0; i < tadLength; i++) { rZ[i * zEWS] = rX[i * xEWS]; } } else { - for (int i = 0; i < tadLength; i++) { + for (Nd4jLong i = 0; i < tadLength; i++) { auto xOffset = xTadOffsetForBlock + shape::getIndexOffset(i, tadShapeInfo); auto zOffset = zTadOffsetForBlock + shape::getIndexOffset(i, zTadShapeInfo); hZ[zOffset] = hX[xOffset]; diff --git a/libnd4j/include/helpers/cpu/MmulHelper.cpp b/libnd4j/include/helpers/cpu/MmulHelper.cpp index f0e8846e3..a2e5bbd34 100644 --- a/libnd4j/include/helpers/cpu/MmulHelper.cpp +++ b/libnd4j/include/helpers/cpu/MmulHelper.cpp @@ -78,7 +78,7 @@ static void usualGemm(const NDArray* vA, const NDArray* vB, NDArray* vC, T3 val = A[aOffset] * B[bOffset]; // first iteration - for (uint j = 1; j < K; ++j) { // rest iterations + for (int j = 1; j < K; ++j) { // rest iterations aOffset += shape::stride(aShapeInfo)[aKaxis]; bOffset += shape::stride(bShapeInfo)[bKaxis]; val = val + A[aOffset] * B[bOffset]; @@ -131,7 +131,7 @@ static void usualGemv(const NDArray* vA, const NDArray* vX, NDArray* vY, const T3 val = A[aOffset] * X[xOffset]; // first iteration - for (uint j = 1; j < N; ++j) { // rest iterations + for (int j = 1; j < N; ++j) { // rest iterations aOffset += aNstride; xOffset += incx; val = val + A[aOffset] * X[xOffset]; @@ -163,7 +163,7 @@ static void usualDot(const Nd4jLong length, const double alpha, const void* vX, T3 sum = 0; PRAGMA_OMP_PARALLEL_FOR_ARGS(OMP_IF(length > Environment::getInstance()->elementwiseThreshold()) schedule(guided) reduction(OMP_SUMT:sum)) - for(int i = 0; i < length; ++i) + for(Nd4jLong i = 0; i < length; ++i) sum += X[i * incx] * Y[i * incy]; if(betaPersent) @@ -462,7 +462,7 @@ static void batchedGemm(const NDArray* vA, const NDArray* vB, NDArray* vC, T3 val = A[aOffset] * B[bOffset]; // first iteration - for (uint j = 1; j < K; ++j) { // rest iterations + for (int j = 1; j < K; ++j) { // rest iterations aOffset += shape::stride(aShapeInfo)[aKaxis]; bOffset += shape::stride(bShapeInfo)[bKaxis]; val = val + A[aOffset] * B[bOffset]; diff --git a/libnd4j/include/helpers/cpu/biDiagonalUp.cpp b/libnd4j/include/helpers/cpu/biDiagonalUp.cpp index 79c77b944..1e3280a82 100644 --- a/libnd4j/include/helpers/cpu/biDiagonalUp.cpp +++ b/libnd4j/include/helpers/cpu/biDiagonalUp.cpp @@ -58,7 +58,7 @@ BiDiagonalUp::BiDiagonalUp(const NDArray& matrix): _HHmatrix(nd4j::NDArrayFactor T _x, _y; - for(int i = 0; i < cols-1; ++i ) { + for(Nd4jLong i = 0; i < cols-1; ++i ) { // evaluate Householder matrix nullifying columns column = new NDArray(_HHmatrix({i,rows, i,i+1}, true)); diff --git a/libnd4j/include/helpers/cpu/loops/IndexReductionLoops.hpp b/libnd4j/include/helpers/cpu/loops/IndexReductionLoops.hpp index b661d02e7..f0e9e8fd5 100644 --- a/libnd4j/include/helpers/cpu/loops/IndexReductionLoops.hpp +++ b/libnd4j/include/helpers/cpu/loops/IndexReductionLoops.hpp @@ -53,7 +53,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint j = 0; j < tadLen; j++) { + for (Nd4jLong j = 0; j < tadLen; j++) { functions::indexreduce::IndexValue comp(tad[j], j); indexValue = OpType::update(indexValue, comp, extraParams); } @@ -74,7 +74,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint j = 0; j < tadLen; j++) { + for (Nd4jLong j = 0; j < tadLen; j++) { functions::indexreduce::IndexValue comp(tad[j * tadEws], j); indexValue = OpType::update(indexValue, comp, extraParams); } @@ -95,7 +95,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint i0 = 0; i0 < tadLen; ++i0) { + for (Nd4jLong i0 = 0; i0 < tadLen; ++i0) { functions::indexreduce::IndexValue comp(tad[i0 * tadStride[0]], i0); indexValue = OpType::update(indexValue, comp, extraParams); } @@ -118,8 +118,8 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint i0 = 0; i0 < tadShape[0]; ++i0) { - for (uint i1 = 0; i1 < tadShape[1]; ++i1) { + for (Nd4jLong i0 = 0; i0 < tadShape[0]; ++i0) { + for (Nd4jLong i1 = 0; i1 < tadShape[1]; ++i1) { const auto tadOffset = i0 * tadStride[0] + i1 * tadStride[1]; const auto tadIndex = i0 * newStride[0] + i1; functions::indexreduce::IndexValue comp(tad[tadOffset], tadIndex); @@ -145,9 +145,9 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint i0 = 0; i0 < tadShape[0]; ++i0) { - for (uint i1 = 0; i1 < tadShape[1]; ++i1) { - for (uint i2 = 0; i2 < tadShape[2]; ++i2) { + for (Nd4jLong i0 = 0; i0 < tadShape[0]; ++i0) { + for (Nd4jLong i1 = 0; i1 < tadShape[1]; ++i1) { + for (Nd4jLong i2 = 0; i2 < tadShape[2]; ++i2) { const auto tadOffset = i0 * tadStride[0] + i1 * tadStride[1] + i2 * tadStride[2]; const auto tadIndex = i0 * newStride[0] + i1 * newStride[1] + i2; functions::indexreduce::IndexValue comp(tad[tadOffset], tadIndex); @@ -174,10 +174,10 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint i0 = 0; i0 < tadShape[0]; ++i0) { - for (uint i1 = 0; i1 < tadShape[1]; ++i1) { - for (uint i2 = 0; i2 < tadShape[2]; ++i2) { - for (uint i3 = 0; i3 < tadShape[3]; ++i3) { + for (Nd4jLong i0 = 0; i0 < tadShape[0]; ++i0) { + for (Nd4jLong i1 = 0; i1 < tadShape[1]; ++i1) { + for (Nd4jLong i2 = 0; i2 < tadShape[2]; ++i2) { + for (Nd4jLong i3 = 0; i3 < tadShape[3]; ++i3) { const auto tadOffset = i0 * tadStride[0] + i1 * tadStride[1] + i2 * tadStride[2] + i3 * tadStride[3]; const auto tadIndex = i0 * newStride[0] + i1 * newStride[1] + i2 * newStride[2] + i3; functions::indexreduce::IndexValue comp(tad[tadOffset], tadIndex); @@ -205,11 +205,11 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint i0 = 0; i0 < tadShape[0]; ++i0) { - for (uint i1 = 0; i1 < tadShape[1]; ++i1) { - for (uint i2 = 0; i2 < tadShape[2]; ++i2) { - for (uint i3 = 0; i3 < tadShape[3]; ++i3) { - for (uint i4 = 0; i4 < tadShape[4]; ++i4) { + for (Nd4jLong i0 = 0; i0 < tadShape[0]; ++i0) { + for (Nd4jLong i1 = 0; i1 < tadShape[1]; ++i1) { + for (Nd4jLong i2 = 0; i2 < tadShape[2]; ++i2) { + for (Nd4jLong i3 = 0; i3 < tadShape[3]; ++i3) { + for (Nd4jLong i4 = 0; i4 < tadShape[4]; ++i4) { const auto tadOffset = i0 * tadStride[0] + i1 * tadStride[1] + i2 * tadStride[2] + i3 * tadStride[3] + i4 * tadStride[4]; const auto tadIndex = i0 * newStride[0] + i1 * newStride[1] + i2 * newStride[2] + i3 * newStride[3] + i4; functions::indexreduce::IndexValue comp(tad[tadOffset], tadIndex); @@ -238,7 +238,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint j = 0; j < tadLen; j++) { + for (Nd4jLong j = 0; j < tadLen; j++) { functions::indexreduce::IndexValue comp(tad[j * tadEws], j); indexValue = OpType::update(indexValue, comp, extraParams); } @@ -262,7 +262,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint j = 0; j < tadLen; j++) { + for (Nd4jLong j = 0; j < tadLen; j++) { auto tadOffset = shape::indexOffset(j, tadShapeInfo, castTadShapeInfo, canCastTad); functions::indexreduce::IndexValue comp(tad[tadOffset], j); indexValue = OpType::update(indexValue, comp, extraParams); @@ -288,7 +288,7 @@ void nd4j::IndexReductionLoops::loopIndexReduce(X* x, Nd4jLong* xShapeInfo, auto tad = const_cast(x) + tadOffsets[i]; auto indexValue = OpType::startingIndexValue(tad); - for (uint j = 0; j < tadLen; j++) { + for (Nd4jLong j = 0; j < tadLen; j++) { auto tadOffset = shape::indexOffset(j, tadShapeInfo, castTadShapeInfo, canCastTad); functions::indexreduce::IndexValue comp(tad[tadOffset], j); indexValue = OpType::update(indexValue, comp, extraParams); diff --git a/libnd4j/include/helpers/cpu/svd.cpp b/libnd4j/include/helpers/cpu/svd.cpp index 4bf2be639..ef129a0d0 100644 --- a/libnd4j/include/helpers/cpu/svd.cpp +++ b/libnd4j/include/helpers/cpu/svd.cpp @@ -374,7 +374,7 @@ T SVD::secularEq(const T diff, const NDArray& col0, const NDArray& diag, cons auto len = permut.lengthOf(); T res = 1.; T item; - for(int i=0; i(i); item = col0.e(j) / ((diagShifted.e(j) - diff) * (diag.e(j) + shift + diff)); res += item * col0.e(j); @@ -383,7 +383,6 @@ T SVD::secularEq(const T diff, const NDArray& col0, const NDArray& diag, cons return res; } - ////////////////////////////////////////////////////////////////////////// template void SVD::calcSingVals(const NDArray& col0, const NDArray& diag, const NDArray& permut, NDArray& singVals, NDArray& shifts, NDArray& mus) { @@ -394,7 +393,7 @@ void SVD::calcSingVals(const NDArray& col0, const NDArray& diag, const NDArra while(curLen > 1 && col0.e(curLen-1) == (T)0.f) --curLen; - for (int k = 0; k < len; ++k) { + for (Nd4jLong k = 0; k < len; ++k) { if (col0.e(k) == (T)0.f || curLen==1) { diff --git a/libnd4j/include/ops/declarable/helpers/impl/lstmLayer.cpp b/libnd4j/include/ops/declarable/helpers/impl/lstmLayer.cpp index 2b65d0c8e..e83b5875d 100644 --- a/libnd4j/include/ops/declarable/helpers/impl/lstmLayer.cpp +++ b/libnd4j/include/ops/declarable/helpers/impl/lstmLayer.cpp @@ -232,13 +232,13 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, if(!h) { // seqLen and h are absent lstmLayerCell(xSet->at(0), Wx, Wr, b, h0, c0, Wp, params, ht, ct); // first time step - for (int t = 1; t < sL; ++t) + for (Nd4jLong t = 1; t < sL; ++t) lstmLayerCell(xSet->at(t), Wx, Wr, b, ht, ct, Wp, params, ht, ct); // rest time steps } else { // seqLen is absent and h is present lstmLayerCell(xSet->at(0), Wx, Wr, b, h0, c0, Wp, params, hSet->at(0), ct); // first time step - for (int t = 1; t < sL; ++t) + for (Nd4jLong t = 1; t < sL; ++t) lstmLayerCell(xSet->at(t), Wx, Wr, b, hSet->at(t - 1), ct, Wp, params, hSet->at(t), ct); // rest time steps if(hL) @@ -249,7 +249,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, if(!h) { // seqLen is present and h is absent - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { const int limit = seqLen->e(e); @@ -272,7 +272,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, } else { // seqLen and h are present - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { int limit = seqLen->e(e); @@ -312,13 +312,13 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, if(!h) { // seqLen and h are absent lstmLayerCell(xSet->at(sL - 1), Wx, Wr, b, h0, c0, Wp, params, ht, ct); // first time step - for (int t = sL - 2; t >= 0; --t) + for (Nd4jLong t = sL - 2; t >= 0; --t) lstmLayerCell(xSet->at(t), Wx, Wr, b, ht, ct, Wp, params, ht, ct); // rest time steps } else { // seqLen is absent and h is present lstmLayerCell(xSet->at(sL - 1), Wx, Wr, b, h0, c0, Wp, params, hSet->at(sL - 1), ct); // first time step - for (int t = sL - 2; t >= 0; --t) + for (Nd4jLong t = sL - 2; t >= 0; --t) lstmLayerCell(xSet->at(t), Wx, Wr, b, hSet->at(t + 1), ct, Wp, params, hSet->at(t), ct); // rest time steps if(hL) @@ -329,7 +329,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, if(!h) { // h is absent and seqLen is present - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { const int limit = seqLen->e(e); @@ -344,7 +344,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, auto ind = getBatchTimeTotalIndex(dataFormat, sL, bS, sL - 1, e); lstmLayerCell(xSet->at(ind), Wx, Wr, b, h0Set->at(e), c0Set->at(e), Wp, params, htSet->at(e), ctSet->at(e)); // first time step - for (int t = sL - 2; t >= sL - limit; --t) { + for (Nd4jLong t = sL - 2; t >= sL - limit; --t) { ind = getBatchTimeTotalIndex(dataFormat, sL, bS, t, e); lstmLayerCell(xSet->at(ind), Wx, Wr, b, htSet->at(e), ctSet->at(e), Wp, params, htSet->at(e), ctSet->at(e)); // rest time steps } @@ -352,7 +352,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, } else { // seqLen and h are present - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { int limit = seqLen->e(e); @@ -371,7 +371,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, auto indPrev = getBatchTimeTotalIndex(dataFormat, sL, bS, sL - 1, e); lstmLayerCell(xSet->at(indPrev), Wx, Wr, b, h0Set->at(e), c0Set->at(e), Wp, params, hSet->at(indPrev), ctSet->at(e)); // first time step - for (int t = sL - 2; t >= sL - limit; --t) { + for (Nd4jLong t = sL - 2; t >= sL - limit; --t) { auto indCurr = getBatchTimeTotalIndex(dataFormat, sL, bS, t, e); lstmLayerCell(xSet->at(indCurr), Wx, Wr, b, hSet->at(indPrev), ctSet->at(e), Wp, params, hSet->at(indCurr), ctSet->at(e)); // rest time steps indPrev = indCurr; @@ -388,7 +388,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, if(!h) { // h is absent and seqLen is present - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { const int limit = seqLen->e(e); @@ -411,7 +411,7 @@ void lstmLayerTimeLoop(const NDArray* x, const NDArray* Wx, const NDArray* Wr, } else { // seqLen and h are present - for (int e = 0; e < bS; ++e) { + for (Nd4jLong e = 0; e < bS; ++e) { int limit = seqLen->e(e); diff --git a/libnd4j/include/ops/declarable/helpers/impl/sparse_to_dense.cpp b/libnd4j/include/ops/declarable/helpers/impl/sparse_to_dense.cpp index e21499314..a6e971cf2 100644 --- a/libnd4j/include/ops/declarable/helpers/impl/sparse_to_dense.cpp +++ b/libnd4j/include/ops/declarable/helpers/impl/sparse_to_dense.cpp @@ -80,7 +80,7 @@ namespace nd4j { valueCoords[e] = indices.e(e); // write results individually - for (uint64_t e = 0; e < numElements; e++) { + for (Nd4jLong e = 0; e < numElements; e++) { auto vIndex = shape::coords2index(output.shapeInfo(), valueCoords.data()); auto cLength = 0L; std::string str; diff --git a/libnd4j/include/ops/declarable/helpers/impl/unique.cpp b/libnd4j/include/ops/declarable/helpers/impl/unique.cpp index d9bee23dc..3a8af9e3d 100644 --- a/libnd4j/include/ops/declarable/helpers/impl/unique.cpp +++ b/libnd4j/include/ops/declarable/helpers/impl/unique.cpp @@ -33,7 +33,7 @@ namespace helpers { std::vector values; - for (int e = 0; e < input->lengthOf(); e++) { + for (Nd4jLong e = 0; e < input->lengthOf(); e++) { T v = input->e(e); if (std::find(values.begin(), values.end(), v) == values.end()) { values.push_back(v); @@ -56,7 +56,7 @@ namespace helpers { MAP_IMPL indicesMap; MAP_IMPL countsMap; - for (int e = 0; e < input->lengthOf(); e++) { + for (Nd4jLong e = 0; e < input->lengthOf(); e++) { T v = input->e(e); if (std::find(valuesVector.begin(), valuesVector.end(), v) == valuesVector.end()) { valuesVector.push_back(v); @@ -77,7 +77,7 @@ namespace helpers { }; samediff::Threads::parallel_for(func, 0, values->lengthOf()); - for (int e = 0; e < indices->lengthOf(); e++) { + for (Nd4jLong e = 0; e < indices->lengthOf(); e++) { auto posI = std::find(valuesVector.begin(), valuesVector.end(), input->e(e)); auto dist = std::distance(valuesVector.begin(), posI); indices->p(e, Nd4jLong(dist));//indicesMap[(*input)(e)]; diff --git a/libnd4j/include/ops/declarable/helpers/impl/where.cpp b/libnd4j/include/ops/declarable/helpers/impl/where.cpp index 5ca54ced9..ed4fe3c97 100644 --- a/libnd4j/include/ops/declarable/helpers/impl/where.cpp +++ b/libnd4j/include/ops/declarable/helpers/impl/where.cpp @@ -30,7 +30,7 @@ namespace nd4j { int cnt = 0; Nd4jLong idx[MAX_RANK]; - for (int e = 0; e < condition.lengthOf(); e++) { + for (Nd4jLong e = 0; e < condition.lengthOf(); e++) { shape::index2coords(e, condition.getShapeInfo(), idx); auto offset = shape::getOffset(condition.getShapeInfo(), idx);