@Test public void testByteBufferInput() throws Exception{ INDArray buff = Nd4j.zeros(new int[]{3}, DataType.BYTE); buff.putScalar(0, 97); buff.putScalar(1, 98); buff.putScalar(2, 99); ((BaseDataBuffer)buff.data()).syncToPrimary(); PythonVariables pyInputs = new PythonVariables(); pyInputs.addBytes("buff", new BytePointer(buff.data().pointer())); PythonVariables pyOutputs= new PythonVariables(); pyOutputs.addStr("out"); String code = "out = bytes(buff).decode()"; Python.exec(code, pyInputs, pyOutputs); Assert.assertEquals("abc", pyOutputs.getStrValue("out")); }
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; }