[ https://issues.apache.org/jira/browse/SYSTEMML-1621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias Boehm resolved SYSTEMML-1621. -------------------------------------- Resolution: Fixed > `max(0, X)` fails with type mismatch > ------------------------------------ > > Key: SYSTEMML-1621 > URL: https://issues.apache.org/jira/browse/SYSTEMML-1621 > Project: SystemML > Issue Type: Bug > Reporter: Mike Dusenberry > Assignee: Matthias Boehm > Fix For: SystemML 1.0 > > > Scenario: Compute the element-wise max of a matrix {{X}} and {{0}}. > Current behavior: {{max(0, X)}} fails, {{max(0.0, X)}} works, and {{max(X, > 0)}} works as well. > Desired behavior: {{max(0, X)}} should work. > How to reproduce: {{nn/layers/relu.dml::forward}} currently contains a > {{max(X, 0)}} function call. When the tests > ({{test/integration/scripts/nn/NNTest.java}}) are run, everything works fine. > However, if this function is adjusted to be {{max(0, X)}}, the tests will > fail during parsing with the following error: > {code} > 17/05/23 11:17:00 ERROR parser.StatementBlock: ERROR: > ./nn/test/grad_check.dml -- line 1729, column 2 -- for function > two_layer_affine_l2_net_forward, return variable aout value type of INT does > not match value type in function signature of DOUBLE and cannot safely cast > double as int > 17/05/23 11:17:00 ERROR api.DMLScript: Failed to execute DML script. > org.apache.sysml.parser.LanguageException: ERROR: ./nn/test/grad_check.dml -- > line 1729, column 2 -- for function two_layer_affine_l2_net_forward, return > variable aout value type of INT does not match value type in function > signature of DOUBLE and cannot safely cast INT as DOUBLE > at > org.apache.sysml.parser.FunctionStatementBlock.validate(FunctionStatementBlock.java:155) > at > org.apache.sysml.parser.DMLTranslator.validateParseTree(DMLTranslator.java:133) > at org.apache.sysml.api.DMLScript.execute(DMLScript.java:758) > at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:506) > at org.apache.sysml.api.DMLScript.main(DMLScript.java:233) > Exception in thread "main" org.apache.sysml.api.DMLException: > org.apache.sysml.parser.LanguageException: ERROR: ./nn/test/grad_check.dml -- > line 1729, column 2 -- for function two_layer_affine_l2_net_forward, return > variable aout value type of INT does not match value type in function > signature of DOUBLE and cannot safely cast INT as DOUBLE > at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:533) > at org.apache.sysml.api.DMLScript.main(DMLScript.java:233) > Caused by: org.apache.sysml.parser.LanguageException: ERROR: > ./nn/test/grad_check.dml -- line 1729, column 2 -- for function > two_layer_affine_l2_net_forward, return variable aout value type of INT does > not match value type in function signature of DOUBLE and cannot safely cast > INT as DOUBLE > at > org.apache.sysml.parser.FunctionStatementBlock.validate(FunctionStatementBlock.java:155) > at > org.apache.sysml.parser.DMLTranslator.validateParseTree(DMLTranslator.java:133) > at org.apache.sysml.api.DMLScript.execute(DMLScript.java:758) > at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:506) > ... 1 more > Failed to run SystemML. Exit code :256 > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)