Baunsgaard commented on code in PR #1590:
URL: https://github.com/apache/systemds/pull/1590#discussion_r853828775
##########
src/main/java/org/apache/sysds/runtime/instructions/fed/ParameterizedBuiltinFEDInstruction.java:
##########
@@ -906,8 +906,8 @@ public GetMatrixCharacteristics(long varID) {
@Override
public FederatedResponse execute(ExecutionContext ec, Data...
data) {
MatrixBlock mb = ((MatrixObject)
data[0]).acquireReadAndRelease();
- int r = mb.getDenseBlockValues() != null ?
mb.getNumRows() : 0;
- int c = mb.getDenseBlockValues() != null ?
mb.getNumColumns() : 0;
+ int r = mb.getDenseBlockValues() != null ||
mb.isInSparseFormat() ? mb.getNumRows() : 0;
+ int c = mb.getDenseBlockValues() != null ||
mb.isInSparseFormat() ? mb.getNumColumns() : 0;
Review Comment:
Cool, thanks for the fix.
But i think we can improve it to work with any matrix type, since you could
use mb.isEmpty()
also, minor thing, in this code you use two calls, and you could make do
with one, if you split the code in if else.
```
if(mb.isEmpty())
return new .... SUCCESS, new int[] {0,0});
return new ... SUCCESS, new int[] {mb.getNumRows(), mb.getNumColumns()};
```
Then everything works with compressed matrices as well :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]