@Test public void testNDArrayShort() throws Exception { PythonVariables pyInputs = new PythonVariables(); PythonVariables pyOutputs = new PythonVariables(); pyInputs.addNDArray("x", Nd4j.zeros(DataType.SHORT, 2, 3)); pyInputs.addNDArray("y", Nd4j.ones(DataType.SHORT, 2, 3)); pyOutputs.addNDArray("z"); String code = "z = x + y"; Python.exec(code, pyInputs, pyOutputs); INDArray z = pyOutputs.getNDArrayValue("z"); Assert.assertEquals(6.0, z.sum().getDouble(0), 1e-5); }
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; }