use of org.apache.sysml.runtime.matrix.operators.UnaryOperator in project incubator-systemml by apache.
the class MatrixBuiltinSPInstruction method processInstruction.
@Override
public void processInstruction(ExecutionContext ec) throws DMLRuntimeException {
SparkExecutionContext sec = (SparkExecutionContext) ec;
//get input
JavaPairRDD<MatrixIndexes, MatrixBlock> in = sec.getBinaryBlockRDDHandleForVariable(input1.getName());
//execute unary builtin operation
UnaryOperator uop = (UnaryOperator) _optr;
JavaPairRDD<MatrixIndexes, MatrixBlock> out = in.mapValues(new RDDMatrixBuiltinUnaryOp(uop));
//set output RDD
updateUnaryOutputMatrixCharacteristics(sec);
sec.setRDDHandleForVariable(output.getName(), out);
sec.addLineageRDD(output.getName(), input1.getName());
}
use of org.apache.sysml.runtime.matrix.operators.UnaryOperator in project incubator-systemml by apache.
the class BuiltinUnarySPInstruction method parseInstruction.
public static BuiltinUnarySPInstruction parseInstruction(String str) throws DMLRuntimeException {
CPOperand in = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN);
CPOperand out = new CPOperand("", ValueType.UNKNOWN, DataType.UNKNOWN);
String opcode = parseUnaryInstruction(str, in, out);
ValueFunction func = Builtin.getBuiltinFnObject(opcode);
return new MatrixBuiltinSPInstruction(new UnaryOperator(func), in, out, opcode, str);
}
Aggregations