public void registerOutput(String varName) throws DMLRuntimeException {
  if (!(DMLScript.rtplatform == RUNTIME_PLATFORM.SPARK || DMLScript.rtplatform == RUNTIME_PLATFORM.HYBRID_SPARK)) {
    throw new DMLRuntimeException("The registerOutput functionality only supported for spark runtime. Please use MLContext(sc) instead of default constructor.");
  }
  if (_outVarnames == null)   _outVarnames=new ArrayList<String>();
  _outVarnames.add(varName);
  if (_variables == null)   _variables=new LocalVariableMap();
}

public void registerOutput ( String varName ) throws DMLRuntimeException { if ( ! ( DMLScript . rtplatform == RUNTIME_PLATFORM . SPARK || DMLScript . rtplatform == RUNTIME_PLATFORM . HYBRID_SPARK ) ) { throw new DMLRuntimeException ( "The registerOutput functionality only supported for spark runtime. Please use MLContext(sc) instead of default constructor." ) ; } if ( _outVarnames == null ) _outVarnames = new ArrayList < String > ( ) ; _outVarnames . add ( varName ) ; if ( _variables == null ) _variables = new LocalVariableMap ( ) ; }
marks the variable in the dml script as output variable . note that this expects a " write ( varname , . . . ) " statement in the dml script which through non - mlcontext invocation would have written the matrix to hdfs .
