Skip to content

Commit

Permalink
Merge pull request #442 from malmaud/active_project
Browse files Browse the repository at this point in the history
Start Python task in current project environment.
  • Loading branch information
malmaud authored Sep 24, 2018
2 parents 0c931a7 + 056250d commit 5d207b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/TensorFlow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ end
function load_python_process(;force_reload=false)
if myid() == 1
(pyproc[] > 0 && !force_reload) && return pyproc[] # Python process already loaded
addprocs(1)
withenv("JULIA_PROJECT"=>Base.active_project()) do
addprocs(1)
end
pyproc[] = nprocs()
py_file = joinpath(dirname(@__FILE__), "py.jl")
Base.eval(Main, quote
Expand Down
3 changes: 2 additions & 1 deletion src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,8 @@ function get_tensor_shape(tensor::AbstractTensor)
end

function get_shape(tensor::AbstractTensor)
if ismissing(get_tensor_num_dims(tensor))
# TODO understand/fix why gradient tensors have 'nothing' for their graph
if get_graph(tensor) === nothing || ismissing(get_tensor_num_dims(tensor))
return TensorShape([], true)
else
return TensorShape(get_tensor_shape(tensor), false)
Expand Down

0 comments on commit 5d207b8

Please sign in to comment.