@Test public void testNDArrayNoCopy() throws Exception{ PythonVariables pyInputs = new PythonVariables(); PythonVariables pyOutputs = new PythonVariables(); INDArray arr = Nd4j.rand(3, 2); ((BaseDataBuffer)arr.data()).syncToPrimary(); pyInputs.addNDArray("x", arr); pyOutputs.addNDArray("x"); INDArray expected = arr.mul(2.3); String code = "x *= 2.3"; Python.exec(code, pyInputs, pyOutputs); Assert.assertEquals(pyInputs.getNDArrayValue("x"), pyOutputs.getNDArrayValue("x")); Assert.assertEquals(expected, pyOutputs.getNDArrayValue("x")); Assert.assertEquals(arr.data().address(), pyOutputs.getNDArrayValue("x").data().address()); }
public static void exec(String code) throws PythonException { simpleExec(getWrappedCode(code)); throwIfExecutionFailed(); }
PythonExecutioner { public static void exec(String code) throws PythonException { simpleExec(getWrappedCode(code)); throwIfExecutionFailed(); } }
PythonExecutioner { public static void exec(String code) throws PythonException { simpleExec(getWrappedCode(code)); throwIfExecutionFailed(); }  }
PythonExecutioner { public static void exec(String code) throws PythonException { simpleExec(getWrappedCode(code)); throwIfExecutionFailed(); }  static boolean validateVariableName(String s); static void setVariable(String varName, PythonObject pythonObject); static void setVariable(String varName, PythonType varType, Object value); static void setVariables(PythonVariables pyVars); static PythonObject getVariable(String varName); static T getVariable(String varName, PythonType<T> varType); static void getVariables(PythonVariables pyVars); static void exec(String code); static void exec(String code, PythonVariables inputVariables, PythonVariables outputVariables); static PythonVariables execAndReturnAllVariables(String code); static PythonVariables getAllVariables(); static PythonVariables execAndReturnAllVariables(String code, PythonVariables inputs); static synchronized void initPythonPath(); }
PythonExecutioner { public static void exec(String code) throws PythonException { simpleExec(getWrappedCode(code)); throwIfExecutionFailed(); }  static boolean validateVariableName(String s); static void setVariable(String varName, PythonObject pythonObject); static void setVariable(String varName, PythonType varType, Object value); static void setVariables(PythonVariables pyVars); static PythonObject getVariable(String varName); static T getVariable(String varName, PythonType<T> varType); static void getVariables(PythonVariables pyVars); static void exec(String code); static void exec(String code, PythonVariables inputVariables, PythonVariables outputVariables); static PythonVariables execAndReturnAllVariables(String code); static PythonVariables getAllVariables(); static PythonVariables execAndReturnAllVariables(String code, PythonVariables inputs); static synchronized void initPythonPath(); final static String DEFAULT_PYTHON_PATH_PROPERTY; final static String JAVACPP_PYTHON_APPEND_TYPE; final static String DEFAULT_APPEND_TYPE; }