use of org.apache.sysml.lops.Nary in project incubator-systemml by apache.
the class NaryOp method constructLops.
/**
* Construct the corresponding Lops for this Hop
*/
@Override
public Lop constructLops() {
// reuse existing lop
if (getLops() != null)
return getLops();
try {
Lop[] inLops = new Lop[getInput().size()];
for (int i = 0; i < getInput().size(); i++) inLops[i] = getInput().get(i).constructLops();
Nary.OperationType opType = HopsOpOpNLops.get(_op);
if (opType == null)
throw new HopsException("Unknown Nary Lop type for '" + _op + "'");
ExecType et = optFindExecType();
Nary multipleCPLop = new Nary(opType, getDataType(), getValueType(), inLops, et);
setOutputDimensions(multipleCPLop);
setLineNumbers(multipleCPLop);
setLops(multipleCPLop);
} catch (Exception e) {
throw new HopsException(this.printErrorLocation() + "error constructing Lops for NaryOp -- \n ", e);
}
// add reblock/checkpoint lops if necessary
constructAndSetLopsDataFlowProperties();
return getLops();
}