ADCME.jl icon indicating copy to clipboard operation
ADCME.jl copied to clipboard

Julia custom operator does not work when Variables are present

Open kailaix opened this issue 6 years ago • 1 comments

When there is a Variable in the upstream operations, Julia custom operator will fail.

Example: JuliaOpModule in ADCME.jl

push!(LOAD_PATH, "..")
include("../JuliaOpModule.jl")
using ADCME
import JuliaOpModule:do_it, DoIt!
x = Variable(rand(100))
y = 2x # or `y = Variable(rand(100))`
u = do_it(y)
sess = Session()
init(sess)
run(sess, u)

kailaix avatar Sep 01 '19 07:09 kailaix

This is mostly due to TensorFlow C++ multithreading. It is not easy to call Julia from a non-event loop thread.

kailaix avatar Sep 20 '19 07:09 kailaix