Guest User

Untitled

a guest
Oct 17th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. (ns graal-test.core
  2. (:import (org.graalvm.polyglot Context)))
  3.  
  4. (def py-context (Context/create (into-array ["python"])))
  5. (.eval py-context "python" "print('Hello polyglot world Python!');")
  6. (.eval py-context "python" "
  7. import time;
  8. time.clock()
  9. ") ;=> #object[org.graalvm.polyglot.Value 0x4a6b3b70 "1.508202803249E9"]
  10.  
  11. ;;; This is what I would love to do!!!
  12. (.eval py-context "python" "
  13. import tensorflow as tf
  14. hello = tf.constant('Hello, TensorFlow!')
  15. sess = tf.Session()
  16. print(sess.run(hello))
  17. ")
Add Comment
Please, Sign In to add comment