Skip to content

Instantly share code, notes, and snippets.

@gigasquid
Created October 17, 2017 10:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gigasquid/994181ca6719c658cd42d21626d26c32 to your computer and use it in GitHub Desktop.
Save gigasquid/994181ca6719c658cd42d21626d26c32 to your computer and use it in GitHub Desktop.
(ns graal-test.core
(:import (org.graalvm.polyglot Context)))
(def py-context (Context/create (into-array ["python"])))
(.eval py-context "python" "print('Hello polyglot world Python!');")
(.eval py-context "python" "
import time;
time.clock()
") ;=> #object[org.graalvm.polyglot.Value 0x4a6b3b70 "1.508202803249E9"]
;;; This is what I would love to do!!!
(.eval py-context "python" "
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment