I would like to use tf.name_scope
for something like this:
my_scope = tf.name_scope('something')
if cond_1:
foo(my_scope)
if cond_2:
bar(my_scope)
I would like to avoid using the with tf.name_scope('something') as scope
notation, as I don't know when the first time I want to use the name scope something
.
The simple my_scope = tf.name_scope('something')
doesn't work, resulting in the error TypeError: expected string or buffer
.
Right now I use:
with tf.name_scope('something') as scope:
pass
my_scope = scope
if cond_1:
foo(my_scope)
if cond_2:
bar(my_scope)
which works, but is very unsatisfying.