[ https://issues.apache.org/jira/browse/SYSTEMML-652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Dusenberry updated SYSTEMML-652: ------------------------------------- Description: I've found a bug in which assigning the result of a DML function to a portion of a matrix with left-indexing results in the left-hand matrix being reduced in size dimensionally. This bug was encountered while working on the deep learning DML library, and the following simplified example aims to provide a simple, reproducible example. Given the following code, {code} forward = function(matrix[double] X) return (matrix[double] out) { out = 1 / (1 + exp(-X)) } N = 3 M = 5 X = rand(rows=N, cols=M) X[,1:2] = forward(X[,1:2]) print("X1: " + nrow(X) + "x" + ncol(X)) X = rand(rows=N, cols=M) temp = forward(X[,1:2]) X[,1:2] = temp if(1==1){} print("X2: " + nrow(X) + "x" + ncol(X)) if(1==1){} print("") {code}, notice that {{X}} should always be a {{3x5}} matrix. However, in the first case, {{X}} is truncated to a {{3x2}} matrix. {code} X1: 3x2 X2: 3x5 {code} Note: The {{if(1==1){}}} statements are included because otherwise the print statements are outputted out of order. was: I've found a bug in which assigning the result of a DML function to a portion of a matrix with left-indexing results in the left-hand matrix being reduced in size dimensionally. This bug was encountered while working on the deep learning DML library, and the following simplified example aims to provide a simple, reproducible example. Given the following code, {code} forward = function(matrix[double] X) return (matrix[double] out) { out = 1 / (1 + exp(-X)) } N = 3 M = 5 X = rand(rows=N, cols=M) X[,1:2] = forward(X[,1:2]) print("X1: " + nrow(X) + "x" + ncol(X)) X = rand(rows=N, cols=M) temp = forward(X[,1:2]) X[,1:2] = temp if(1==1){} print("X2: " + nrow(X) + "x" + ncol(X)) if(1==1){} print("") {code}, notice that {{X}} should always be a {{3x5}} matrix. However, in the first case, {{X}} is truncated to a {{3x2}} matrix. {code} X1: 3x2 X2: 3x5 {code} Note: The {{if(1==1)}} statements are included because otherwise the print statements are outputted out of order. > Left-Indexing With Result of DML Function Changes Matrix Size > ------------------------------------------------------------- > > Key: SYSTEMML-652 > URL: https://issues.apache.org/jira/browse/SYSTEMML-652 > Project: SystemML > Issue Type: Bug > Reporter: Mike Dusenberry > > I've found a bug in which assigning the result of a DML function to a portion > of a matrix with left-indexing results in the left-hand matrix being reduced > in size dimensionally. This bug was encountered while working on the deep > learning DML library, and the following simplified example aims to provide a > simple, reproducible example. > Given the following code, > {code} > forward = function(matrix[double] X) return (matrix[double] out) { > out = 1 / (1 + exp(-X)) > } > N = 3 > M = 5 > X = rand(rows=N, cols=M) > X[,1:2] = forward(X[,1:2]) > print("X1: " + nrow(X) + "x" + ncol(X)) > X = rand(rows=N, cols=M) > temp = forward(X[,1:2]) > X[,1:2] = temp > if(1==1){} > print("X2: " + nrow(X) + "x" + ncol(X)) > if(1==1){} > print("") > {code}, > notice that {{X}} should always be a {{3x5}} matrix. However, in the first > case, {{X}} is truncated to a {{3x2}} matrix. > {code} > X1: 3x2 > X2: 3x5 > {code} > Note: The {{if(1==1){}}} statements are included because otherwise the print > statements are outputted out of order. -- This message was sent by Atlassian JIRA (v6.3.4#6332)