File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 142
142
function load_python_process (;force_reload= false )
143
143
if myid () == 1
144
144
(pyproc[] > 0 && ! force_reload) && return pyproc[] # Python process already loaded
145
- addprocs (1 )
145
+ withenv (" JULIA_PROJECT" => Base. active_project ()) do
146
+ addprocs (1 )
147
+ end
146
148
pyproc[] = nprocs ()
147
149
py_file = joinpath (dirname (@__FILE__ ), " py.jl" )
148
150
Base. eval (Main, quote
Original file line number Diff line number Diff line change @@ -1819,7 +1819,8 @@ function get_tensor_shape(tensor::AbstractTensor)
1819
1819
end
1820
1820
1821
1821
function get_shape (tensor:: AbstractTensor )
1822
- if ismissing (get_tensor_num_dims (tensor))
1822
+ # TODO understand/fix why gradient tensors have 'nothing' for their graph
1823
+ if get_graph (tensor) === nothing || ismissing (get_tensor_num_dims (tensor))
1823
1824
return TensorShape ([], true )
1824
1825
else
1825
1826
return TensorShape (get_tensor_shape (tensor), false )
You can’t perform that action at this time.
0 commit comments