-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
FLIP-206 compares PemJa to Jython, GraalVM, JPype and Jep
deeplearning4j's Python4J framework seems more comparable to PemJa than any of these
It depends on javacpp-presets which bundles CPython into a Jar and depends on java-cpp to abstract from the JNI
API example:
try(PythonGIL gil = PythonGIL.lock()){
try(PythonGC gc = PythonGC.watch()){
List<PythonVariable> inputs = new ArrayList<>();
inputs.add(new PythonVariable<>("x", PythonTypes.STR, "Hello "));
inputs.add(new PythonVariable<>("y", PythonTypes.STR, "World"));
PythonVariable out = new PythonVariable<>("z", PythonTypes.STR);
String code = "z = x + y";
PythonExecutioner.exec(code, inputs, Collections.singletonList(out));
System.out.println(out.getValue());
}
}catch (Throwable e){
e.printStackTrace();
}A comparison between this approach and that of PemJa would be very useful
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels