Repository: incubator-systemml
Updated Branches:
  refs/heads/master 5de7beea2 -> 8a5450dde


[SYSTEMML-1474] Bugfix for scipy csr and numpy to matrixblock conversion

Closes #455.


Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/8a5450dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/8a5450dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/8a5450dd

Branch: refs/heads/master
Commit: 8a5450dde5b55c6fb67d9fb034b69e5eafa15bf7
Parents: 5de7bee
Author: Niketan Pansare <[email protected]>
Authored: Sat Apr 8 19:28:28 2017 -0800
Committer: Niketan Pansare <[email protected]>
Committed: Sat Apr 8 20:28:28 2017 -0700

----------------------------------------------------------------------
 src/main/python/systemml/converters.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/8a5450dd/src/main/python/systemml/converters.py
----------------------------------------------------------------------
diff --git a/src/main/python/systemml/converters.py 
b/src/main/python/systemml/converters.py
index 416e5f9..9651f14 100644
--- a/src/main/python/systemml/converters.py
+++ b/src/main/python/systemml/converters.py
@@ -80,7 +80,8 @@ def _convertDenseMatrixToMB(sc, src):
 
 def _copyRowBlock(i, sc, ret, src, numRowsPerBlock,  rlen, clen):
     rowIndex = int(i / numRowsPerBlock)
-    mb = _convertSPMatrixToMB(sc, src[i:i+numRowsPerBlock,]) if 
isinstance(src, spmatrix) else _convertDenseMatrixToMB(sc, 
src[i:i+numRowsPerBlock,])
+    tmp = src[i:min(i+numRowsPerBlock, rlen),]
+    mb = _convertSPMatrixToMB(sc, tmp) if isinstance(src, spmatrix) else 
_convertDenseMatrixToMB(sc, tmp)
     
sc._jvm.org.apache.sysml.runtime.instructions.spark.utils.RDDConverterUtilsExt.copyRowBlocks(mb,
 rowIndex, ret, numRowsPerBlock, rlen, clen)
     return i
     

Reply via email to