Search in sources :

Example 1 with ZeroOutOperator

use of org.apache.sysml.runtime.matrix.operators.ZeroOutOperator in project incubator-systemml by apache.

the class ZeroOutInstruction method parseInstruction.

public static ZeroOutInstruction parseInstruction(String str) {
    InstructionUtils.checkNumFields(str, 6);
    String[] parts = InstructionUtils.getInstructionParts(str);
    String opcode = parts[0];
    if (!opcode.equalsIgnoreCase("zeroOut"))
        throw new DMLRuntimeException("Unknown opcode while parsing a zeroout: " + str);
    byte in = Byte.parseByte(parts[1]);
    IndexRange rng = new IndexRange(UtilFunctions.parseToLong(parts[2]), UtilFunctions.parseToLong(parts[3]), UtilFunctions.parseToLong(parts[4]), UtilFunctions.parseToLong(parts[5]));
    byte out = Byte.parseByte(parts[6]);
    return new ZeroOutInstruction(new ZeroOutOperator(), in, out, rng, str);
}
Also used : IndexRange(org.apache.sysml.runtime.util.IndexRange) ZeroOutOperator(org.apache.sysml.runtime.matrix.operators.ZeroOutOperator) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException)

Aggregations

DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)1 ZeroOutOperator (org.apache.sysml.runtime.matrix.operators.ZeroOutOperator)1 IndexRange (org.apache.sysml.runtime.util.IndexRange)1