use of org.apache.sysml.api.mlcontext.ScriptExecutor in project incubator-systemml by apache.
the class MLContextTest method testCustomExecutionStepPYDML.
@Test
public void testCustomExecutionStepPYDML() {
System.out.println("MLContextTest - custom execution step PYDML");
String testString = "custom execution step";
setExpectedStdOut(testString);
Script script = new Script("print('" + testString + "')", org.apache.sysml.api.mlcontext.ScriptType.PYDML);
ScriptExecutor scriptExecutor = new ScriptExecutor() {
@Override
protected void showExplanation() {
}
};
ml.execute(script, scriptExecutor);
}
use of org.apache.sysml.api.mlcontext.ScriptExecutor in project systemml by apache.
the class GenerateClassesForMLContext method dmlProgramFromScriptFilePath.
/**
* Create a DMLProgram from a script file.
*
* @param scriptFilePath
* the path to a script file
* @return the DMLProgram generated by the script file
*/
public static DMLProgram dmlProgramFromScriptFilePath(String scriptFilePath) {
String scriptString = fileToString(scriptFilePath);
Script script = new Script(scriptString);
ScriptExecutor se = new ScriptExecutor() {
@Override
public MLResults execute(Script script) {
setup(script);
parseScript();
return null;
}
};
se.execute(script);
DMLProgram dmlProgram = se.getDmlProgram();
return dmlProgram;
}
use of org.apache.sysml.api.mlcontext.ScriptExecutor in project systemml by apache.
the class MLContextTest method testCustomExecutionStepPYDML.
@Test
public void testCustomExecutionStepPYDML() {
System.out.println("MLContextTest - custom execution step PYDML");
String testString = "custom execution step";
setExpectedStdOut(testString);
Script script = new Script("print('" + testString + "')", org.apache.sysml.api.mlcontext.ScriptType.PYDML);
ScriptExecutor scriptExecutor = new ScriptExecutor() {
@Override
protected void showExplanation() {
}
};
ml.execute(script, scriptExecutor);
}
use of org.apache.sysml.api.mlcontext.ScriptExecutor in project incubator-systemml by apache.
the class MLContextTest method testCustomExecutionStepDML.
@Test
public void testCustomExecutionStepDML() {
System.out.println("MLContextTest - custom execution step DML");
String testString = "custom execution step";
setExpectedStdOut(testString);
Script script = new Script("print('" + testString + "');", org.apache.sysml.api.mlcontext.ScriptType.DML);
ScriptExecutor scriptExecutor = new ScriptExecutor() {
@Override
protected void showExplanation() {
}
};
ml.execute(script, scriptExecutor);
}
use of org.apache.sysml.api.mlcontext.ScriptExecutor in project incubator-systemml by apache.
the class GenerateClassesForMLContext method dmlProgramFromScriptFilePath.
/**
* Create a DMLProgram from a script file.
*
* @param scriptFilePath
* the path to a script file
* @return the DMLProgram generated by the script file
*/
public static DMLProgram dmlProgramFromScriptFilePath(String scriptFilePath) {
String scriptString = fileToString(scriptFilePath);
Script script = new Script(scriptString);
ScriptExecutor se = new ScriptExecutor() {
@Override
public MLResults execute(Script script) {
setup(script);
parseScript();
return null;
}
};
se.execute(script);
DMLProgram dmlProgram = se.getDmlProgram();
return dmlProgram;
}
Aggregations