Skip to content

Commit 64ba17e

Browse files
committed
Externalize variables
1 parent 5ca4427 commit 64ba17e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/ops/control_flow.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ end
473473
474474
"""
475475
function internalize(outer_graph, body_func, cond_func, var_list, loop_name, stack_depth=1, input_overrides=Int[])
476-
if stack_depth > 2
477-
error("internalize is recursing too much")
478-
return nothing
479-
end
476+
# if stack_depth > 2
477+
# error("internalize is recursing too much")
478+
# return nothing
479+
# end
480480
external_name = nothing
481481
try
482482
body_graph = Graph()

src/variable.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ function Variable(initial_value; name="", trainable=true, literal_name=false)
7979
return self
8080
else
8181
parent_graph = graph.parent.graph
82-
base_name = name[(length(graph.parent.prefix)+2):end] # maybe use regex instead
82+
# base_name = name[(length(graph.parent.prefix)+2):end] # maybe use regex instead
83+
base_name = name
8384
parent_var = tf.get_tensor_by_name(parent_graph, base_name)
8485
if parent_var === nothing
8586
tf.as_default(parent_graph) do

0 commit comments

Comments
 (0)