Skip to content

Commit 6b164dc

Browse files
committed
Workaround for #810
1 parent 66285a3 commit 6b164dc

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/Core/Algorithms/Math/GetMatrixSliceAlgo.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ boost::tuple<MatrixHandle, int> GetMatrixSliceAlgo::runImpl(MatrixHandle matrix,
8080
{
8181
auto sparse = matrix_cast::as_sparse(matrix);
8282
if (sparse)
83-
return boost::make_tuple(boost::make_shared<SparseRowMatrix>(sparse->col(index)), max);
83+
{
84+
THROW_ALGORITHM_PROCESSING_ERROR("TODO: need a fix for slicing a column from SparseRowMatrix. Direct Eigen call is buggy. Waiting on an Eigen upgrade");
85+
}
8486
return boost::make_tuple(nullptr, 0);
8587
}
8688
}
@@ -89,7 +91,6 @@ boost::tuple<MatrixHandle, int> GetMatrixSliceAlgo::runImpl(MatrixHandle matrix,
8991
checkIndex(index, matrix->nrows());
9092
auto max = matrix->nrows() - 1;
9193

92-
// dense case only now
9394
auto dense = matrix_cast::as_dense(matrix);
9495
if (dense)
9596
return boost::make_tuple(boost::make_shared<DenseMatrix>(dense->row(index)), max);

src/ExampleNets/regression/sliceMatrix.srn5

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<!DOCTYPE boost_serialization>
3-
<boost_serialization signature="serialization::archive" version="10">
3+
<boost_serialization signature="serialization::archive" version="11">
44
<networkFile class_id="0" tracking_level="0" version="2">
55
<networkInfo class_id="1" tracking_level="0" version="0">
66
<modules class_id="2" tracking_level="0" version="0">
@@ -183,7 +183,7 @@
183183
<name>IsSliceColumn</name>
184184
<value>
185185
<which>3</which>
186-
<value>1</value>
186+
<value>0</value>
187187
</value>
188188
</second>
189189
</item>
@@ -195,7 +195,7 @@
195195
<name>MaxIndex</name>
196196
<value>
197197
<which>0</which>
198-
<value>2</value>
198+
<value>1</value>
199199
</value>
200200
</second>
201201
</item>
@@ -319,43 +319,43 @@
319319
<item class_id="16" tracking_level="0" version="0">
320320
<first>ConvertMatrixType:3</first>
321321
<second class_id="17" tracking_level="0" version="0">
322-
<first>-1672</first>
323-
<second>-1216</second>
322+
<first>-1.67200000000000000e+003</first>
323+
<second>-1.21600000000000000e+003</second>
324324
</second>
325325
</item>
326326
<item>
327327
<first>CreateMatrix:2</first>
328328
<second>
329-
<first>-1900</first>
330-
<second>-1368</second>
329+
<first>-1.90000000000000000e+003</first>
330+
<second>-1.36800000000000000e+003</second>
331331
</second>
332332
</item>
333333
<item>
334334
<first>GetMatrixSlice:0</first>
335335
<second>
336-
<first>-1976</first>
337-
<second>-1064</second>
336+
<first>-1.97600000000000000e+003</first>
337+
<second>-1.06400000000000000e+003</second>
338338
</second>
339339
</item>
340340
<item>
341341
<first>GetMatrixSlice:4</first>
342342
<second>
343-
<first>-1672</first>
344-
<second>-1064</second>
343+
<first>-1.67200000000000000e+003</first>
344+
<second>-1.06400000000000000e+003</second>
345345
</second>
346346
</item>
347347
<item>
348348
<first>ReportMatrixInfo:1</first>
349349
<second>
350-
<first>-1976</first>
351-
<second>-912</second>
350+
<first>-1.97600000000000000e+003</first>
351+
<second>-9.12000000000000000e+002</second>
352352
</second>
353353
</item>
354354
<item>
355355
<first>ReportMatrixInfo:5</first>
356356
<second>
357-
<first>-1672</first>
358-
<second>-912</second>
357+
<first>-1.67200000000000000e+003</first>
358+
<second>-9.12000000000000000e+002</second>
359359
</second>
360360
</item>
361361
</modulePositions>

0 commit comments

Comments
 (0)